(timeoutMs, taskName)
| 426 | } |
| 427 | |
| 428 | function getTimeoutPromise(timeoutMs, taskName) { |
| 429 | let timer |
| 430 | if (timeoutMs) debug(`Timing out in ${timeoutMs}ms`) |
| 431 | return [ |
| 432 | new Promise((done, reject) => { |
| 433 | timer = setTimeout(() => { |
| 434 | reject(new TimeoutError(`Action ${taskName} was interrupted on timeout ${timeoutMs}ms`)) |
| 435 | }, timeoutMs || 2e9) |
| 436 | }), |
| 437 | timer, |
| 438 | ] |
| 439 | } |
| 440 | |
| 441 | function currentQueue() { |
| 442 | let session = '' |