unify 72 magic number behind named constant
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
const config = require('../config')
|
||||
const minecraftVersions = require('../minecraft_versions')
|
||||
|
||||
const SERVER_GRAPH_DATA_MAX_LENGTH = 72
|
||||
|
||||
class ServerRegistration {
|
||||
serverId
|
||||
lastFavicon
|
||||
@ -105,7 +107,7 @@ class ServerRegistration {
|
||||
this._pingHistory.push(ping)
|
||||
|
||||
// Trim pingHistory to avoid memory leaks
|
||||
if (this._pingHistory.length > 72) {
|
||||
if (this._pingHistory.length > SERVER_GRAPH_DATA_MAX_LENGTH) {
|
||||
this._pingHistory.shift()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user