Create method to check if Fibers is enabled by flag DISABLE_FIBERS.

This commit is contained in:
Edimar Cardoso
2022-07-21 17:20:45 -03:00
parent 10a1e01417
commit bb37fae4c5
2 changed files with 10 additions and 0 deletions

View File

@@ -171,3 +171,5 @@ function logErr(err) {
);
}
}
Meteor.isFibersEnabled = global.isFibersEnabled;

View File

@@ -14,6 +14,14 @@ var MIN_NODE_VERSION = 'v14.0.0';
var hasOwn = Object.prototype.hasOwnProperty;
// For now it's a function to ensure we don't get a falsy value.
// Once we figure out the best place to create this EV (maybe it's here),
// it won't need to be a function anymore.
global.isFibersEnabled = function () {
return !process.env.DISABLE_FIBERS;
};
if (require('semver').lt(process.version, MIN_NODE_VERSION)) {
process.stderr.write(
'Meteor requires Node ' + MIN_NODE_VERSION + ' or later.\n');