remove timeout tasks since updates occur in bulk now

This commit is contained in:
Nick Krecklow
2020-05-08 03:27:01 -05:00
parent 63a01ace95
commit 4104c4144a
3 changed files with 12 additions and 29 deletions

View File

@ -82,6 +82,8 @@ export class SocketManager {
break
case 'updateServers': {
let requestGraphRedraw = false
for (let serverId = 0; serverId < payload.updates.length; serverId++) {
// The backend may send "update" events prior to receiving all "add" events
// A server has only been added once it's ServerRegistration is defined
@ -105,10 +107,19 @@ export class SocketManager {
// Only redraw the graph if not mutating hidden data
if (serverRegistration.isVisible) {
this._app.graphDisplayManager.requestRedraw()
requestGraphRedraw = true
}
}
}
// Run redraw tasks after handling bulk updates
if (requestGraphRedraw) {
this._app.graphDisplayManager.redraw()
}
this._app.percentageBar.redraw()
this._app.updateGlobalStats()
break
}