mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-23 13:48:49 +00:00
Merge pull request #439 from embark-framework/uv_close_fix
only close watcher when it's actually ready
This commit is contained in:
commit
db6b90e77f
@ -41,8 +41,9 @@ class Watch {
|
|||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
this.fileWatchers.forEach(fileWatcher => {
|
this.fileWatchers.forEach(fileWatcher => {
|
||||||
fileWatcher.close();
|
if (fileWatcher.shouldClose) return;
|
||||||
fileWatcher = null;
|
if (fileWatcher.isReady) fileWatcher.close();
|
||||||
|
fileWatcher.shouldClose = true;
|
||||||
});
|
});
|
||||||
this.fileWatchers = [];
|
this.fileWatchers = [];
|
||||||
}
|
}
|
||||||
@ -125,7 +126,11 @@ class Watch {
|
|||||||
.on('add', path => changeCallback('add', path))
|
.on('add', path => changeCallback('add', path))
|
||||||
.on('change', path => changeCallback('change', path))
|
.on('change', path => changeCallback('change', path))
|
||||||
.on('unlink', path => changeCallback('remove', path))
|
.on('unlink', path => changeCallback('remove', path))
|
||||||
.on('ready', doneCallback);
|
.once('ready', () => {
|
||||||
|
configWatcher.isReady = true;
|
||||||
|
if (configWatcher.shouldClose) configWatcher.close();
|
||||||
|
doneCallback();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user