mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Use __meteor_bootstrap__ to check if fibers enabled
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
Meteor.fibersDisabled = true;
|
||||
|
||||
Meteor._isPromise = (r) => {
|
||||
return r && typeof r.then === 'function';
|
||||
};
|
||||
|
||||
@@ -2,7 +2,9 @@ const getAslStore = () => (Meteor.isServer && global?.asyncLocalStorage?.getStor
|
||||
const getValueFromAslStore = key => getAslStore()[key];
|
||||
const updateAslStore = (key, value) => getAslStore()[key] = value;
|
||||
|
||||
Meteor._isFibersEnabled = !process.env.DISABLE_FIBERS && Meteor.isServer;
|
||||
Meteor.fibersDisabled = !!__meteor_bootstrap__.fibersDisabled;
|
||||
Meteor._isFibersEnabled = !Meteor.fibersDisabled;
|
||||
|
||||
Meteor._getAslStore = getAslStore;
|
||||
Meteor._getValueFromAslStore = getValueFromAslStore;
|
||||
Meteor._updateAslStore = updateAslStore;
|
||||
|
||||
@@ -472,8 +472,19 @@ Object.assign(Isopack.prototype, {
|
||||
// case right.)
|
||||
}, async function () {
|
||||
// Make a new Plugin API object for this plugin.
|
||||
var Plugin = self._makePluginApi(name);
|
||||
await plugin.load({ Plugin: Plugin, Profile: Profile });
|
||||
const Plugin = self._makePluginApi(name);
|
||||
const __meteor_bootstrap__ = {
|
||||
fibersDisabled: true,
|
||||
// Set to null to tell Meteor.startup to call hooks immediately
|
||||
// XXX: should we fully support startup hooks in build plugins?
|
||||
startupHooks: null
|
||||
};
|
||||
|
||||
await plugin.load({
|
||||
Plugin,
|
||||
Profile,
|
||||
__meteor_bootstrap__
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ var starJson = JSON.parse(fs.readFileSync(path.join(buildDir, "star.json")));
|
||||
__meteor_bootstrap__ = {
|
||||
startupHooks: [],
|
||||
serverDir: serverDir,
|
||||
configJson: configJson
|
||||
configJson: configJson,
|
||||
fibersDisabled: true
|
||||
};
|
||||
|
||||
__meteor_runtime_config__ = {
|
||||
@@ -504,4 +505,3 @@ var runMain = Profile("Run main()", async function () {
|
||||
});
|
||||
});
|
||||
})().catch(e => console.log('error on boot.js', e));
|
||||
|
||||
|
||||
@@ -303,7 +303,10 @@ var loadIsopacketFromDisk = async function (isopacketName) {
|
||||
// An incredibly minimalist version of the environment from
|
||||
// tools/server/boot.js. Kind of a hack.
|
||||
var env = {
|
||||
__meteor_bootstrap__: { startupHooks: [] },
|
||||
__meteor_bootstrap__: {
|
||||
startupHooks: [],
|
||||
fibersDisabled: true
|
||||
},
|
||||
__meteor_runtime_config__: { meteorRelease: "ISOPACKET" }
|
||||
};
|
||||
env.Profile = Profile;
|
||||
|
||||
Reference in New Issue
Block a user