removed dataKey where it's not necessary anymore (use of CLS instead)

This commit is contained in:
azivner
2018-03-31 08:53:52 -04:00
parent 5d203b2278
commit 05676f3459
12 changed files with 78 additions and 105 deletions

View File

@@ -38,6 +38,7 @@ const router = express.Router();
const auth = require('../services/auth');
const cls = require('../services/cls');
const sql = require('../services/sql');
const protectedSessionService = require('../services/protected_session');
function apiResultHandler(res, result) {
// if it's an array and first element is integer then we consider this to be [statusCode, response] format
@@ -67,6 +68,7 @@ function route(method, path, middleware, routeHandler, resultHandler) {
try {
const result = await cls.init(async () => {
cls.namespace.set('sourceId', req.headers.source_id);
protectedSessionService.setProtectedSessionId(req);
return await sql.doInTransaction(async () => {
return await routeHandler(req, res, next);