Correctly set isFibersDisabled on asl-helpers

This commit is contained in:
matheusccastro
2023-05-03 10:04:47 -03:00
parent c005be57c1
commit 09ff7671a4
2 changed files with 3 additions and 4 deletions

View File

@@ -1,11 +1,10 @@
const getAslStore = () => (Meteor.isServer && global?.asyncLocalStorage?.getStore()) || {};
const getValueFromAslStore = key => getAslStore()[key];
const updateAslStore = (key, value) => getAslStore()[key] = value;
const bootstrap = global.__meteor_bootstrap__;
Meteor.isFibersDisabled = !!(bootstrap && bootstrap.isFibersDisabled);
// From 3.0 onwards, fibers is disabled by default.
Meteor.isFibersDisabled = __meteor_bootstrap__ && __meteor_bootstrap__.isFibersDisabled !== false;
Meteor._isFibersEnabled = !Meteor.isFibersDisabled;
Meteor._getAslStore = getAslStore;

View File

@@ -10,7 +10,7 @@ const makeGlobalAsyncLocalStorage = () => {
return global.asyncLocalStorage;
};
const getAslStore = () => asyncLocalStorage.getStore();
const getAslStore = () => global.asyncLocalStorage.getStore();
const getValueFromAslStore = key => getAslStore()[key];
const updateAslStore = (key, value) => getAslStore()[key] = value;