MCPcopy
hub / github.com/sequelize/sequelize / _clsRun

Method _clsRun

src/sequelize.js:1242–1249  ·  view source on GitHub ↗

* Run function in CLS context. * If no CLS context in use, just runs the function normally * * @private * @param {Function} fn Function to run * @returns {*} Return value of function

(fn)

Source from the content-addressed store, hash-verified

1240 * @returns {*} Return value of function
1241 */
1242 static _clsRun(fn) {
1243 const ns = Sequelize._cls;
1244 if (!ns) return fn();
1245
1246 let res;
1247 ns.run(context => res = fn(context));
1248 return res;
1249 }
1250
1251 log(...args) {
1252 let options;

Callers 2

cls.test.jsFile · 0.80
transactionMethod · 0.80

Calls 1

runMethod · 0.45

Tested by

no test coverage detected