mirror of
https://github.com/strapi/strapi.git
synced 2025-07-21 07:57:45 +00:00
18 lines
286 B
JavaScript
18 lines
286 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
const { AsyncLocalStorage } = require('async_hooks');
|
||
|
|
||
|
const storage = new AsyncLocalStorage();
|
||
|
|
||
|
const transactionCtx = {
|
||
|
async run(store, cb) {
|
||
|
return storage.run(store, cb);
|
||
|
},
|
||
|
|
||
|
get() {
|
||
|
return storage.getStore();
|
||
|
},
|
||
|
};
|
||
|
|
||
|
module.exports = transactionCtx;
|