kopia lustrzana https://github.com/c9/core
revert watcher changes causing memory leak
rodzic
ab9cb53cf8
commit
38fac42a0d
|
@ -1380,23 +1380,21 @@ module.exports = function setup(fsOptions) {
|
||||||
});
|
});
|
||||||
callback(done);
|
callback(done);
|
||||||
|
|
||||||
function loop(watchers, path, event, callback) {
|
function done(callback) {
|
||||||
if (!watchers.length)
|
if (!watchers.length)
|
||||||
return callback();
|
return callback();
|
||||||
|
|
||||||
|
// Notify each watcher of changes and reactivate it
|
||||||
var watcher = watchers.pop();
|
var watcher = watchers.pop();
|
||||||
watcher.handleWatchEvent(event, basename(path), true);
|
fs.stat(path, function(err, stat) {
|
||||||
|
if (err || !stat) return;
|
||||||
|
stat.vfsWrite = true;
|
||||||
|
watcher.sendToAllListeners("change", basename(path), stat);
|
||||||
|
});
|
||||||
watcher.resume(function() {
|
watcher.resume(function() {
|
||||||
loop(watchers, path, event, callback);
|
done(callback);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function done(callback) {
|
|
||||||
loop(watchers, path, "change", function() {
|
|
||||||
loop(dirWatchers, parentDir, "directory", callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function connect(port, options, callback) {
|
function connect(port, options, callback) {
|
||||||
|
|
Ładowanie…
Reference in New Issue