Skip to content

Commit

Permalink
Merge 914317c into 73c12a0
Browse files Browse the repository at this point in the history
  • Loading branch information
mzgoddard committed Dec 2, 2016
2 parents 73c12a0 + 914317c commit 46bfb80
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/DirectoryWatcher.js
Expand Up @@ -83,7 +83,8 @@ DirectoryWatcher.prototype.setFileTime = function setFileTime(filePath, mtime, i
this.files[filePath] = [initial ? Math.min(now, mtime) : now, mtime];

// we add the fs accurency to reach the maximum possible mtime
mtime = mtime + FS_ACCURENCY;
if(mtime)
mtime = mtime + FS_ACCURENCY;

if(!old) {
if(mtime) {
Expand Down Expand Up @@ -144,10 +145,15 @@ DirectoryWatcher.prototype.setDirectory = function setDirectory(directoryPath, e

DirectoryWatcher.prototype.createNestedWatcher = function(directoryPath) {
this.directories[directoryPath] = watcherManager.watchDirectory(directoryPath, this.options, 1);
this.directories[directoryPath].directoryWatcher.parentInitialScan = this.initialScan;
this.directories[directoryPath].on("change", function(filePath, mtime) {
var directoryWatcher = this.directories[directoryPath].directoryWatcher;
var selfInitial = directoryWatcher.initialScan;
var parentInitial = directoryWatcher.parentInitialScan;
var initial = selfInitial && parentInitial;
if(this.watchers[withoutCase(this.path)]) {
this.watchers[withoutCase(this.path)].forEach(function(w) {
if(w.checkStartTime(mtime, false)) {
if(!initial || w.checkStartTime(mtime, false)) {
w.emit("change", filePath, mtime);
}
});
Expand Down

0 comments on commit 46bfb80

Please sign in to comment.