Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/async/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,18 @@ class Notifier {
* @param {Number} timeout - timeout milliseconds to wait (max).
*/
add (outputFile, timeout) {
let failTimeout = timeout;
let timer;

if (!this.isStarted()) {
throw new Error("MUST call `start` before `add`");
}

if (!this._exists(outputFile)) {
// make sure we evaluate after the child process
failTimeout = parseInt(timeout, 10) + parseInt(this.padTimeout, 10);
let failTimeout = parseInt(timeout, 10) + parseInt(this.padTimeout, 10);
// Stagger and grow the failure timeout padding, add 1s every 10 processes
this.padTimeout += 100;

// setup a timeout handler to detect failure
timer = setTimeout(this.csFactory(done => {
let timer = setTimeout(this.csFactory(done => {
// if the output file has not already been removed
if (this._exists(outputFile)) {
pathExists(outputFile)
Expand Down
Loading