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: [])
|
@set 'parts', Travis.ChunkBuffer.create(content: [])
|
||||||
|
|
||||||
#@addObserver 'body', @fetchWorker
|
|
||||||
#@fetchWorker()
|
|
||||||
|
|
||||||
id: (->
|
id: (->
|
||||||
@get('job.id')
|
@get('job.id')
|
||||||
).property('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')
|
Travis.Artifact.Request.create(id: id, handlers: handlers).run() if id = @get('job.id')
|
||||||
|
|
||||||
append: (part) ->
|
append: (part) ->
|
||||||
|
@fetchWorker Ember.get(part, 'content')
|
||||||
@get('parts').pushObject(part)
|
@get('parts').pushObject(part)
|
||||||
|
|
||||||
loadParts: (parts) ->
|
loadParts: (parts) ->
|
||||||
|
@ -54,14 +52,13 @@ require 'travis/chunk_buffer'
|
||||||
@append(number: 1, content: text)
|
@append(number: 1, content: text)
|
||||||
@set('isLoaded', true)
|
@set('isLoaded', true)
|
||||||
|
|
||||||
fetchWorker: ->
|
fetchWorker: (string) ->
|
||||||
if !@get('workerName') && (body = @get('body'))
|
if !@get('workerName')
|
||||||
line = body.split("\n")[0]
|
line = string.split("\n")[0]
|
||||||
if line && (match = line.match /Using worker: (.*)/)
|
if line && (match = line.match /Using worker: (.*)/)
|
||||||
if worker = match[1]
|
if worker = match[1]
|
||||||
worker = worker.trim().split(':')[0]
|
worker = worker.trim().split(':')[0]
|
||||||
@set('workerName', worker)
|
@set('workerName', worker)
|
||||||
@removeObserver 'body', @fetchWorker
|
|
||||||
|
|
||||||
Travis.Artifact.Request = Em.Object.extend
|
Travis.Artifact.Request = Em.Object.extend
|
||||||
HEADERS:
|
HEADERS:
|
||||||
|
|
|
@ -97,7 +97,6 @@ Travis.Store = DS.Store.extend
|
||||||
|
|
||||||
if event == 'job:log'
|
if event == 'job:log'
|
||||||
if job = @find(Travis.Job, data['job']['id'])
|
if job = @find(Travis.Job, data['job']['id'])
|
||||||
console.log 'job:log', data
|
|
||||||
job.appendLog(number: data['job']['number'], content: data['job']['_log'])
|
job.appendLog(number: data['job']['number'], content: data['job']['_log'])
|
||||||
else if data[type.singularName()]
|
else if data[type.singularName()]
|
||||||
@_loadOne(this, type, data)
|
@_loadOne(this, type, data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user