Browse Source

refactor: disable metrics middleware

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4930/head
Pranav C 2 years ago
parent
commit
38bd788060
  1. 9
      packages/nocodb/src/lib/meta/helpers/apiMetrics.ts

9
packages/nocodb/src/lib/meta/helpers/apiMetrics.ts

@ -3,6 +3,7 @@ import { Tele } from 'nc-help';
const countMap = {}; const countMap = {};
// @ts-ignore
const metrics = async (req: Request, c = 150) => { const metrics = async (req: Request, c = 150) => {
if (!req?.route?.path) return; if (!req?.route?.path) return;
const event = `a:api:${req.route.path}:${req.method}`; const event = `a:api:${req.route.path}:${req.method}`;
@ -13,12 +14,12 @@ const metrics = async (req: Request, c = 150) => {
} }
}; };
const metaApiMetrics = (req: Request, _res, next) => { const metaApiMetrics = (_req: Request, _res, next) => {
metrics(req, 50).then(() => {}); // metrics(req, 50).then(() => {});
next(); next();
}; };
export default (req: Request, _res, next) => { export default (_req: Request, _res, next) => {
metrics(req).then(() => {}); // metrics(req).then(() => {});
next(); next();
}; };

Loading…
Cancel
Save