do not append serverId in getPingHistory entries

This commit is contained in:
Nick Krecklow 2020-05-08 01:25:38 -05:00
parent c2494af82d
commit 7993ac0077
No known key found for this signature in database
GPG Key ID: 5F149FDE156FFA94
4 changed files with 6 additions and 8 deletions

View File

@ -102,13 +102,13 @@ export class App {
.reduce((sum, current) => sum + current, 0)
}
addServer = (pings, timestampPoints) => {
addServer = (serverId, pings, timestampPoints) => {
// Even if the backend has never pinged the server, the frontend is promised a placeholder object.
// result = undefined
// error = defined with "Waiting" description
// info = safely defined with configured data
const latestPing = pings[pings.length - 1]
const serverRegistration = this.serverRegistry.createServerRegistration(latestPing.serverId)
const serverRegistration = this.serverRegistry.createServerRegistration(serverId)
serverRegistration.initServerStatus(latestPing)

View File

@ -67,8 +67,8 @@ export class SocketManager {
}
}
payload.servers.forEach(server => {
this._app.addServer(server, payload.timestampPoints)
payload.servers.forEach((pings, serverId) => {
this._app.addServer(serverId, pings, payload.timestampPoints)
})
if (payload.mojangServices) {

View File

@ -10,8 +10,8 @@
"connectTimeout": 2500
},
"performance": {
"skipUnfurlSrv": false
"skipUnfurlSrv": true
},
"logToDatabase": false,
"logToDatabase": true,
"graphDuration": 86400000
}

View File

@ -124,7 +124,6 @@ class ServerRegistration {
const lastPing = this._pingHistory[this._pingHistory.length - 1]
const payload = {
serverId: this.serverId,
versions: this.versions,
recordData: this.recordData,
favicon: this.lastFavicon
@ -153,7 +152,6 @@ class ServerRegistration {
}
return [{
serverId: this.serverId,
error: {
message: 'Waiting...',
placeholder: true