Skip to content

Commit 36daffc

Browse files
author
Ben Newman
committed
Cope with asynchronous ChildProcess.prototype.send in Node v4.
nodejs/node#2620 Part of #6921.
1 parent 6a4241c commit 36daffc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tools/runners/run-app.js

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

851857
// Establish a watcher on the new files.
852858
setupClientWatcher();

0 commit comments

Comments
 (0)