(mutexFilename, isFirstTime)
| 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) { |
no test coverage detected