Fix fetching worker name

This commit is contained in:
Piotr Sarnacki 2013-03-05 23:54:54 +01:00
parent b289d3966b
commit 05926e0010
2 changed files with 4 additions and 8 deletions

View File

@ -14,9 +14,6 @@ require 'travis/chunk_buffer'
@set 'parts', Travis.ChunkBuffer.create(content: [])
#@addObserver 'body', @fetchWorker
#@fetchWorker()
id: (->
@get('job.id')
).property('job.id')
@ -41,6 +38,7 @@ require 'travis/chunk_buffer'
Travis.Artifact.Request.create(id: id, handlers: handlers).run() if id = @get('job.id')
append: (part) ->
@fetchWorker Ember.get(part, 'content')
@get('parts').pushObject(part)
loadParts: (parts) ->
@ -54,14 +52,13 @@ require 'travis/chunk_buffer'
@append(number: 1, content: text)
@set('isLoaded', true)
fetchWorker: ->
if !@get('workerName') && (body = @get('body'))
line = body.split("\n")[0]
fetchWorker: (string) ->
if !@get('workerName')
line = string.split("\n")[0]
if line && (match = line.match /Using worker: (.*)/)
if worker = match[1]
worker = worker.trim().split(':')[0]
@set('workerName', worker)
@removeObserver 'body', @fetchWorker
Travis.Artifact.Request = Em.Object.extend
HEADERS:

View File

@ -97,7 +97,6 @@ Travis.Store = DS.Store.extend
if event == 'job:log'
if job = @find(Travis.Job, data['job']['id'])
console.log 'job:log', data
job.appendLog(number: data['job']['number'], content: data['job']['_log'])
else if data[type.singularName()]
@_loadOne(this, type, data)