* 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)
| 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; |
no test coverage detected