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:
Pagan Gazzard 2015-03-08 12:28:29 +00:00 committed by Pablo Carranza Vélez
parent 2c94ea57a2
commit 7765bc6a59
2 changed files with 1 additions and 7 deletions

View File

@ -1,5 +1,4 @@
_ = require 'lodash'
es = require 'event-stream'
url = require 'url'
knex = require './db'
path = require 'path'

View File

@ -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)