Skip to content

Commit

Permalink
Ignore accessTime updates caused by read operations (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
markablov authored and paulmillr committed Feb 5, 2019
1 parent 0a46e6f commit fb8ef5e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/nodefs-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,24 @@ function(file, stats, initialAdd, callback) {
if (error) {
this._remove(dirname, basename);
} else {
this._emit('change', file, newStats);
// check that change event was not fired coz of changed accessTime
if (
!newStats.atime.getTime() ||
newStats.atime.getTime() <= newStats.mtime.getTime()
) {
this._emit('change', file, newStats);
}
}
}.bind(this));
// add is about to be emitted if file not already tracked in parent
} else if (parent.has(basename)) {
this._emit('change', file, newStats);
// check that change event was not fired coz of changed accessTime
if (
!newStats.atime.getTime() ||
newStats.atime.getTime() <= newStats.mtime.getTime()
) {
this._emit('change', file, newStats);
}
}
}.bind(this));

Expand Down

0 comments on commit fb8ef5e

Please sign in to comment.