diff --git a/index.js b/index.js index 510843d..85b42d8 100644 --- a/index.js +++ b/index.js @@ -26,6 +26,12 @@ module.exports = { create: create }; +/* + Some fittings utilize 'async'. This breaks continual-local-storage (cls) if being used. + Require cls before async to preserve the callbacks + */ +var cls = require('continuation-local-storage'); + var _ = require('lodash'); var yaml = require('js-yaml'); var path = require('path'); diff --git a/package.json b/package.json index 028fa5c..f699e7e 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "bagpipes": "^0.1.0", "body-parser": "^1.14.1", "config": "^1.16.0", + "continuation-local-storage": "^3.1.7", "cors": "^2.5.3", "debug": "^2.1.3", "js-yaml": "^3.3.0",