mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-05-31 06:41:05 +00:00
We can use mapSync as we don't need anything asynchronous, also we can return nothing as we're done with the stream data at that point.
This commit is contained in:
parent
ef4c4b9ae6
commit
85e1777a65
@ -48,12 +48,12 @@ startNewSupervisor = (currentSupervisor, waitForSuccess = true) ->
|
||||
es.pipeline(
|
||||
stream
|
||||
es.split()
|
||||
es.map (line, callback) ->
|
||||
es.mapSync (line) ->
|
||||
# ignore first 8 characters of every line that are a header sent by docker attach
|
||||
data = line.substr(8)
|
||||
if data is config.successMessage
|
||||
resolve(container)
|
||||
callback(null, data)
|
||||
return
|
||||
)
|
||||
stream.on 'end', ->
|
||||
reject(new Error('New supervisor stopped before success message'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user