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