yocto_console_view: Handle change notification performance issues

The previous approach was basically repeatedly adding change nofification
calls recursively which could lock up the browser. It turns out nofitications
are not being generated properly in upstream buildbot.

https://github.com/buildbot/buildbot/issues/4321
https://github.com/buildbot/buildbot/pull/4323

For now accept a UI regression which will get fixed when the above is
fixed. Avoid the current performance problems.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2018-09-13 10:13:03 +01:00
parent 681db49a98
commit c4b8a6ea0e
2 changed files with 10 additions and 11 deletions

View File

@ -87,16 +87,15 @@ class Console extends Controller
@builds.onChange = @changes.onChange = @buildrequests.onChange = @buildsets.onChange = @onChange
@dataAccessor.getBuilds().onChange = (builds) =>
for b in builds
b.getProperties().onChange = (properties) =>
buildid = properties.endpoint.split('/')[1]
if ! @maping[buildid]
rev = @getBuildProperty(properties[0], 'yp_build_revision')
if rev?
@maping[buildid] = rev
if not @onchange_debounce?
@onchange_debounce = @$timeout(@_onChange, 100)
@builds.onNew = (build) =>
build.getProperties().onChange = (properties) =>
buildid = properties.endpoint.split('/')[1]
if ! @maping[buildid]
rev = @getBuildProperty(properties[0], 'yp_build_revision')
if rev?
@maping[buildid] = rev
if not @onchange_debounce?
@onchange_debounce = @$timeout(@_onChange, 100)
getBuildProperty: (properties, property) ->
hasProperty = properties && properties.hasOwnProperty(property)

File diff suppressed because one or more lines are too long