Skip to content

Commit

Permalink
testing fix for smb share
Browse files Browse the repository at this point in the history
  • Loading branch information
vdiez committed Apr 26, 2016
1 parent 69a5493 commit 88a3f0d
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,20 +299,19 @@ FSWatcher.prototype._awaitWriteFinish = function(path, threshold, event, awfEmit
}.bind(this));
}.bind(this));

if (!(path in this._pendingWrites)) {
this._pendingWrites[path] = {
lastChange: now,
cancelWait: function() {
delete this._pendingWrites[path];
clearTimeout(timeoutHandler);
return event;
}.bind(this)
};
timeoutHandler = setTimeout(
awaitWriteFinish.bind(this),
this.options.awaitWriteFinish.pollInterval
);
}
if (this._pendingWrites[path]) this._pendingWrites[path].cancelWait();

this._pendingWrites[path] = {
lastChange: now,
cancelWait: function() {
delete this._pendingWrites[path];
clearTimeout(timeoutHandler);
}.bind(this)
};
timeoutHandler = setTimeout(
awaitWriteFinish.bind(this),
this.options.awaitWriteFinish.pollInterval
);
};

// Private method: Determines whether user has asked to ignore this path
Expand Down

0 comments on commit 88a3f0d

Please sign in to comment.