Skip to content

Commit

Permalink
chore: merge branch
Browse files Browse the repository at this point in the history
Merge branch 'fix-watch-init-restarts' of https://github.com/faergeek/nodemon into faergeek-fix-watch-init-restarts
  • Loading branch information
remy committed Oct 25, 2015
2 parents 6052fec + 7e7dc04 commit 68cbf47
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/monitor/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var utils = require('../utils');
var bus = utils.bus;
var match = require('./match');
var watchers = [];
var ready = false;
var debouncedBus;

bus.on('reset', resetWatchers);
Expand All @@ -23,7 +22,6 @@ function resetWatchers() {
watcher.close();
});
watchers = [];
ready = false;
}


Expand Down Expand Up @@ -57,11 +55,13 @@ function watch() {
usePolling: config.options.legacyWatch || false,
});

watcher.ready = false;

var total = 0;

watcher.on('change', filterAndRestart);
watcher.on('add', function (file) {
if (ready) {
if (watcher.ready) {
return filterAndRestart(file);
}

Expand All @@ -70,7 +70,7 @@ function watch() {
debug('watching dir: %s', file);
});
watcher.on('ready', function () {
ready = true;
watcher.ready = true;
resolve(total);
debugRoot('watch is complete');
});
Expand Down

0 comments on commit 68cbf47

Please sign in to comment.