merge updateHistoryGraph behavior into update flag

This commit is contained in:
Nick Krecklow
2020-04-29 04:21:50 -05:00
parent 7d47e9b5f8
commit 7322b8dc82
3 changed files with 28 additions and 26 deletions

View File

@ -14,7 +14,7 @@ class ServerRegistration {
this._pingHistory = []
}
getUpdate (timestamp, resp, err, version) {
getUpdate (timestamp, resp, err, version, updateHistoryGraph) {
const update = {
serverId: this.serverId,
timestamp: timestamp
@ -55,6 +55,12 @@ class ServerRegistration {
if (this.findNewGraphPeak()) {
update.graphPeakData = this.getGraphPeak()
}
// Handled inside logToDatabase to validate logic from #getUpdate call
// Only append when true since an undefined value == false
if (updateHistoryGraph) {
update.updateHistoryGraph = true
}
}
} else if (err) {
// Append a filtered copy of err