mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-05 09:10:49 +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(
|
es.pipeline(
|
||||||
stream
|
stream
|
||||||
es.split()
|
es.split()
|
||||||
es.map (line, callback) ->
|
es.mapSync (line) ->
|
||||||
# ignore first 8 characters of every line that are a header sent by docker attach
|
# ignore first 8 characters of every line that are a header sent by docker attach
|
||||||
data = line.substr(8)
|
data = line.substr(8)
|
||||||
if data is config.successMessage
|
if data is config.successMessage
|
||||||
resolve(container)
|
resolve(container)
|
||||||
callback(null, data)
|
return
|
||||||
)
|
)
|
||||||
stream.on 'end', ->
|
stream.on 'end', ->
|
||||||
reject(new Error('New supervisor stopped before success message'))
|
reject(new Error('New supervisor stopped before success message'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user