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

Method _clsRun

lib/sequelize.js:1160–1167  ·  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

1158 * @returns {*} Return value of function
1159 */
1160 static _clsRun(fn) {
1161 const ns = Sequelize._cls;
1162 if (!ns) return fn();
1163
1164 let res;
1165 ns.run(context => res = fn(context));
1166 return res;
1167 }
1168
1169 log(...args) {
1170 let options;

Callers 2

transactionMethod · 0.80
cls.test.jsFile · 0.80

Calls 1

runMethod · 0.45

Tested by

no test coverage detected