Skip to content

Commit 92a8fdb

Browse files
author
Ben Newman
committed
Cope with asynchronous ChildProcess.prototype.send in Node v4.
nodejs/node#2620 Part of #6921.
1 parent d79f595 commit 92a8fdb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/runners/run-app.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,14 @@ _.extend(AppRunner.prototype, {
843843
// Notify the server that new client assets have been added to the
844844
// build.
845845
self._refreshing = true;
846-
appProcess.proc.send({ refresh: 'client' });
847-
self._refreshing = false;
846+
// ChildProcess.prototype.send used to be synchronous, but is now
847+
// asynchronous: https://github.com/nodejs/node/pull/2620
848+
appProcess.proc.send({
849+
refresh: 'client'
850+
}, err => {
851+
self._refreshing = false;
852+
if (err) throw err;
853+
});
848854

849855
// Establish a watcher on the new files.
850856
setupClientWatcher();

0 commit comments

Comments
 (0)