Open zivester opened 10 years ago
this is an issue on node 0.12 / gaze v0.5.2 as well. i tracked the problem down to the forEachSeries iterator.
wrapping iterator in a nextTick resolves the issue. https://github.com/shama/gaze/blob/v0.5.2/lib/helper.js#L52
dropping this in after your gaze include fixed it for me:
var gazeHelper = require('gaze/lib/helper.js');
gazeHelper.forEachSeries = function forEachSeries(arr, iterator, callback) {
if (!arr.length) { return callback(); }
var completed = 0;
var iterate = function() {
process.nextTick(function() {
iterator(arr[completed], function (err) {
if (err) {
callback(err);
callback = function() {};
} else {
completed += 1;
if (completed === arr.length) {
callback(null);
} else {
iterate();
}
}
});
});
};
iterate();
};
This is the same error as on #94 , but I'm able to reproduce it on v0.10.28. Is this just a limitation on this lib? Why can others support watching more than ~5k files?
reproduce:
output
May be relevant (also happens on Ubuntu 14.04)