Merge pull request #1013 from lbryio/noMetrics

stops logging metrics to localdb
This commit is contained in:
Jeremy Kauffman 2019-06-05 11:02:09 -04:00 committed by GitHub
commit 3d4ad3d827
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -20,10 +20,7 @@ const { setupBlockList } = require('./utils/blockList');
const speechPassport = require('./speechPassport');
const processTrending = require('./utils/processTrending');
const {
logMetricsMiddleware,
setRouteDataInContextMiddleware,
} = require('./middleware/logMetricsMiddleware');
const { setRouteDataInContextMiddleware } = require('./middleware/httpContextMiddleware');
const {
details: { port: PORT, blockListEndpoint },
@ -145,7 +142,7 @@ function Server() {
app[routeMethod](
routePath,
logMetricsMiddleware,
// logMetricsMiddleware,
setRouteDataInContextMiddleware(routePath, routeData),
...controllers
);

View file

@ -0,0 +1,13 @@
const httpContext = require('express-http-context');
function setRouteDataInContextMiddleware(routePath, routeData) {
return function(req, res, next) {
httpContext.set('routePath', routePath);
httpContext.set('routeData', routeData);
next();
};
}
module.exports = {
setRouteDataInContextMiddleware,
};