test fix for historical graph retaining too much data
This commit is contained in:
parent
e226066a61
commit
0402df0bc6
@ -171,13 +171,8 @@ class ServerRegistration {
|
||||
this._lastGraphDataPush = timestamp
|
||||
|
||||
// Trim old graphPoints according to graphDuration
|
||||
for (let i = 1; i < this.graphData.length; i++) {
|
||||
// Find a break point where i - 1 is too old and i is new
|
||||
if (timestamp - this.graphData[i - 1][0] > config.graphDuration && timestamp - this.graphData[i] <= config.graphDuration) {
|
||||
this.graphData.splice(0, i)
|
||||
break
|
||||
}
|
||||
}
|
||||
const filterTimestamp = new Date().getTime() - config.graphDuration
|
||||
this.graphData = this.graphData.filter(point => point[0] >= filterTimestamp)
|
||||
|
||||
return true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user