mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-19 16:40:48 +00:00
Make sure we don't duplicate historical logs when streaming
This commit is contained in:
parent
f9cf0aaf23
commit
4388a248b9
@ -50,11 +50,11 @@ module.exports =
|
||||
timestamp = moment(line.timestamp).format('DD.MM.YY HH:mm:ss (ZZ)')
|
||||
console.log("#{timestamp} #{line.message}")
|
||||
|
||||
promise = resin.logs.history(params.uuid).each(printLine)
|
||||
promise = if options.tail
|
||||
resin.logs.subscribe(params.uuid).then (logs) ->
|
||||
logs.on('line', printLine)
|
||||
logs.on('error', done)
|
||||
else
|
||||
resin.logs.history(params.uuid).each(printLine)
|
||||
|
||||
promise.then ->
|
||||
if options.tail
|
||||
resin.logs.subscribe(params.uuid).then (logs) ->
|
||||
logs.on('line', printLine)
|
||||
logs.on('error', done)
|
||||
.catch(done)
|
||||
promise.catch(done)
|
||||
|
Loading…
x
Reference in New Issue
Block a user