Skip to content

Commit

Permalink
Fix duped change events for redundant watch paths
Browse files Browse the repository at this point in the history
Resolves gh-224

Applies throttling on change events always, not just with atomic: true
  • Loading branch information
es128 committed Feb 10, 2015
1 parent eacddd7 commit 553fc6f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ FSWatcher.prototype._emit = function(event, path, val1, val2, val3) {
event = args[0] = 'change';
delete this._pendingUnlinks[path];
}
if (event === 'change') {
if (!this._throttle('change', path, 50)) return this;
}
}

if (event === 'change') {
if (!this._throttle('change', path, 50)) return this;
}

var emitEvent = function() {
Expand Down

0 comments on commit 553fc6f

Please sign in to comment.