mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 17:52:51 +00:00
Just consume the stream for publish, avoiding any chance of it returning a value and getting stored up in the stream.
This commit is contained in:
parent
2c94ea57a2
commit
7765bc6a59
@ -1,5 +1,4 @@
|
||||
_ = require 'lodash'
|
||||
es = require 'event-stream'
|
||||
url = require 'url'
|
||||
knex = require './db'
|
||||
path = require 'path'
|
||||
|
@ -43,14 +43,9 @@ publish = do ->
|
||||
exports.log = ->
|
||||
publish(arguments...)
|
||||
|
||||
# Helps in blinking the LED from the given end point.
|
||||
exports.attach = (app) ->
|
||||
dockerPromise.then (docker) ->
|
||||
docker.getContainer(app.containerId)
|
||||
.attachAsync({ stream: true, stdout: true, stderr: true, tty: true })
|
||||
.then (stream) ->
|
||||
es.pipeline(
|
||||
stream
|
||||
es.split()
|
||||
es.mapSync(publish)
|
||||
)
|
||||
stream.pipe(es.split()).on('data', publish)
|
||||
|
Loading…
x
Reference in New Issue
Block a user