Fix event-stream usage.

This commit is contained in:
Pagan Gazzard 2014-07-21 10:35:45 +01:00 committed by Pablo Carranza Vélez
parent f317927284
commit 5bd4ee7ee6
2 changed files with 6 additions and 2 deletions

View File

@ -75,7 +75,9 @@ exports.start = start = (app) ->
stream.pipe(JSONStream.parse('error'))
.pipe(es.mapSync(reject))
else
stream.pipe(es.wait((error, text) -> reject(text)))
stream.pipe es.wait (error, text) ->
if error
reject(text)
stream.on('end', resolve)
.then ->

View File

@ -63,7 +63,9 @@ exports.initialised = currentSupervisor.then (currentSupervisor) ->
stream.pipe(JSONStream.parse('error'))
.pipe(es.mapSync(reject))
else
stream.pipe(es.wait((error, text) -> reject(text)))
stream.pipe es.wait (error, text) ->
if error
reject(text)
stream.on('end', resolve)
.then ->