MCPcopy
hub / github.com/Kong/insomnia / runEventuallyWithFile

Function runEventuallyWithFile

packages/insomnia/bin/yarn-standalone.js:89119–89142  ·  view source on GitHub ↗
(mutexFilename, isFirstTime)

Source from the content-addressed store, hash-verified

89117
89118 //
89119 const runEventuallyWithFile = function runEventuallyWithFile(mutexFilename, isFirstTime) {
89120 return new Promise(function (resolve) {
89121 const lockFilename = mutexFilename || (_path || _load_path()).default.join(config.cwd, (_constants || _load_constants()).SINGLE_INSTANCE_FILENAME);
89122 (_properLockfile || _load_properLockfile()).default.lock(lockFilename, { realpath: false }, function (err, release) {
89123 if (err) {
89124 if (isFirstTime) {
89125 reporter.warn(reporter.lang('waitingInstance'));
89126 }
89127 setTimeout(function () {
89128 resolve(runEventuallyWithFile(mutexFilename, false));
89129 }, 200); // do not starve the CPU
89130 } else {
89131 (0, (_death || _load_death()).default)(function () {
89132 process.exitCode = 1;
89133 });
89134 resolve(run().then(function () {
89135 return new Promise(function (resolve) {
89136 return release(resolve);
89137 });
89138 }));
89139 }
89140 });
89141 });
89142 };
89143
89144 const runEventuallyWithNetwork = function runEventuallyWithNetwork(mutexPort) {
89145 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.70
warnMethod · 0.45
langMethod · 0.45

Tested by

no test coverage detected