Fix fetching worker name
This commit is contained in:
parent
b289d3966b
commit
05926e0010
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user