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

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

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

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

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