unify 72 magic number behind named constant

This commit is contained in:
Nick Krecklow
2020-05-08 01:27:21 -05:00
parent 7993ac0077
commit aee7b565b2
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,5 @@
const SERVER_GRAPH_DATA_MAX_LENGTH = require('./servers').SERVER_GRAPH_DATA_MAX_LENGTH
class TimeTracker {
constructor () {
this._points = []
@ -8,7 +10,7 @@ class TimeTracker {
this._points.push(timestamp)
if (this._points.length > 72) {
if (this._points.length > SERVER_GRAPH_DATA_MAX_LENGTH) {
this._points.shift()
}