Comparing version 0.1.4 to 0.1.5
@@ -271,16 +271,23 @@ /* | ||
var watchTwo = function() { done(null, file); }; | ||
_this._watchers[file] = fs.watch(file, opts, function(event) { | ||
if (typeof watchOne === 'function') { | ||
watchTwo = null; | ||
watchOne(); | ||
} | ||
}); | ||
fs.watchFile(file, opts, function(curr, prev) { | ||
if (curr.mtime.getTime() !== prev.mtime.getTime()) { | ||
if (typeof watchTwo === 'function') { | ||
watchOne = null; | ||
watchTwo(); | ||
try { | ||
_this._watchers[file] = fs.watch(file, opts, function(event) { | ||
if (typeof watchOne === 'function') { | ||
watchTwo = null; | ||
watchOne(); | ||
} | ||
}); | ||
fs.watchFile(file, opts, function(curr, prev) { | ||
if (curr.mtime.getTime() !== prev.mtime.getTime()) { | ||
if (typeof watchTwo === 'function') { | ||
watchOne = null; | ||
watchTwo(); | ||
} | ||
} | ||
}); | ||
} catch (err) { | ||
if (err.code === 'EMFILE') { | ||
return this.emit('error', new Error('EMFILE: Too many opened files.')); | ||
} | ||
}); | ||
return this.emit('error', err); | ||
} | ||
return this; | ||
@@ -287,0 +294,0 @@ }; |
{ | ||
"name": "gaze", | ||
"description": "A globbing fs.watch wrapper built from the best parts of other fine watch libs.", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/shama/gaze", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -141,2 +141,3 @@ # gaze [![Build Status](https://secure.travis-ci.org/shama/gaze.png?branch=master)](http://travis-ci.org/shama/gaze) | ||
## Release History | ||
* 0.1.5 - Catch too many open file errors | ||
* 0.1.4 - Really fix the race condition with 2 watches | ||
@@ -143,0 +144,0 @@ * 0.1.3 - Fix race condition with 2 watches |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26099
625
151