MCPcopy
hub / github.com/vercel/hyper / runEventuallyWithFile

Function runEventuallyWithFile

bin/yarn-standalone.js:100171–100194  ·  view source on GitHub ↗
(mutexFilename, isFirstTime)

Source from the content-addressed store, hash-verified

100169
100170 //
100171 const runEventuallyWithFile = function runEventuallyWithFile(mutexFilename, isFirstTime) {
100172 return new Promise(function (resolve) {
100173 const lockFilename = mutexFilename || (_path || _load_path()).default.join(config.cwd, (_constants || _load_constants()).SINGLE_INSTANCE_FILENAME);
100174 (_properLockfile || _load_properLockfile()).default.lock(lockFilename, { realpath: false }, function (err, release) {
100175 if (err) {
100176 if (isFirstTime) {
100177 reporter.warn(reporter.lang('waitingInstance'));
100178 }
100179 setTimeout(function () {
100180 resolve(runEventuallyWithFile(mutexFilename, false));
100181 }, 200); // do not starve the CPU
100182 } else {
100183 (0, (_death || _load_death()).default)(function () {
100184 process.exitCode = 1;
100185 });
100186 resolve(run().then(function () {
100187 return new Promise(function (resolve) {
100188 return release(resolve);
100189 });
100190 }));
100191 }
100192 });
100193 });
100194 };
100195
100196 const runEventuallyWithNetwork = function runEventuallyWithNetwork(mutexPort) {
100197 return new Promise(function (resolve, reject) {

Callers 1

yarn-standalone.jsFile · 0.85

Calls 8

_load_pathFunction · 0.85
_load_constantsFunction · 0.85
_load_properLockfileFunction · 0.85
resolveFunction · 0.85
_load_deathFunction · 0.85
runFunction · 0.85
warnMethod · 0.45
langMethod · 0.45

Tested by

no test coverage detected