From 972fb6fb43b87515433954977948807056d4e240 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 7 Oct 2013 17:15:57 +0200 Subject: [PATCH] Always subscribe to log updates When the job is restart, we will not get any updates unless we're subscribed to job updates - that's why we need to subscribe even if the job is already finished. The other option to fix this would be to subscribe and unsubscribe also based on the status, but since subscribing to finished jobs does not cost us anything, I prefer the simpler solution. --- assets/scripts/app/views/log.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/scripts/app/views/log.coffee b/assets/scripts/app/views/log.coffee index 471bc06f..2fccda0e 100644 --- a/assets/scripts/app/views/log.coffee +++ b/assets/scripts/app/views/log.coffee @@ -13,7 +13,7 @@ Travis.reopen job = @get('job') if job job.get('log').fetch() - job.subscribe() if !job.get('isFinished') + job.subscribe() willDestroyElement: -> job = @get('job') @@ -37,6 +37,11 @@ Travis.reopen @rerender() if @get('state') == 'inDOM' ).observes('log.version') + logDidChange: (-> + console.log 'log view: log did change: rerender' if Log.DEBUG + @rerender() if @get('state') == 'inDOM' + ).observes('log') + createEngine: -> console.log 'log view: create engine' if Log.DEBUG @scroll = new Log.Scroll