From ee9f9d934c85ec1e173e9da3eef045540db0df5f Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 23 Jan 2013 21:33:08 +0100 Subject: [PATCH] Don't instantiate repo nor job on worker updates We can create thos records based on job:started event. Also, links used on the workers list are created from attributes only anyway. --- assets/scripts/app/store.coffee | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/assets/scripts/app/store.coffee b/assets/scripts/app/store.coffee index 0a411d65..4b5e14e2 100644 --- a/assets/scripts/app/store.coffee +++ b/assets/scripts/app/store.coffee @@ -68,8 +68,6 @@ Travis.Store = DS.Store.extend { id: id, clientId: clientId } receive: (event, data) -> - # return if event == 'worker:added' || event == 'worker:removed' - [name, type] = event.split(':') mappings = @adapter.get('mappings') @@ -111,14 +109,7 @@ Travis.Store = DS.Store.extend # things I want to update here: if type == Travis.Build && (json.repository || json.repo) @loadIncomplete(Travis.Repo, json.repository || json.repo) - else if type == Travis.Worker && json.worker.payload - if repo = (json.worker.payload.repo || json.worker.payload.repository) - # I use skipIfExists here, cause worker payload is usually outdated - # If there is no info on repo yet, it's worth to add it, but if it already - # exists, we will most likely end up with inconsistent situation - @loadIncomplete(Travis.Repo, repo, skipIfExists: true) - if job = json.worker.payload.job - @loadIncomplete(Travis.Job, job) + @loadIncomplete(type, json[root]) addLoadedData: (type, clientId, hash) ->