yocto_console_view: Only request properties for running builds which don't have them

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2018-11-16 13:49:59 +00:00
parent 81273de5ac
commit a60c841a49
2 changed files with 24 additions and 14 deletions

View File

@ -89,6 +89,15 @@ class Console extends Controller
@builds.onChange = @changes.onChange = @buildrequests.onChange = @buildsets.onChange = @onChange @builds.onChange = @changes.onChange = @buildrequests.onChange = @buildsets.onChange = @onChange
@builds.onNew = (build) => @builds.onNew = (build) =>
change = false
buildid = build.buildid
if build.properties?.yp_build_revision?
@revmapping[build.buildid] = build.properties.yp_build_revision[0]
change = true
if build.properties?.yp_build_branch?
@branchmapping[build.buildid] = build.properties.yp_build_branch[0]
change = true
if (! @revmapping[buildid] || ! @branchmapping[buildid]) && ! build.complete_at
build.getProperties().onChange = (properties) => build.getProperties().onChange = (properties) =>
change = false change = false
buildid = properties.endpoint.split('/')[1] buildid = properties.endpoint.split('/')[1]
@ -104,7 +113,8 @@ class Console extends Controller
change = true change = true
if change and not @onchange_debounce? if change and not @onchange_debounce?
@onchange_debounce = @$timeout(@_onChange, 100) @onchange_debounce = @$timeout(@_onChange, 100)
if change and not @onchange_debounce?
@onchange_debounce = @$timeout(@_onChange, 100)
getBuildProperty: (properties, property) -> getBuildProperty: (properties, property) ->
hasProperty = properties && properties.hasOwnProperty(property) hasProperty = properties && properties.hasOwnProperty(property)

File diff suppressed because one or more lines are too long