Fix issues when logToDatabase is disabled.
This commit is contained in:
parent
123967cac4
commit
7ea8332a52
4
app.js
4
app.js
@ -89,6 +89,7 @@ function pingAll() {
|
||||
// The same mechanic from trimUselessPings is seen here.
|
||||
// If we dropped the ping, then to avoid destroying the graph, ignore it.
|
||||
// However if it's been too long since the last successful ping, we'll send it anyways.
|
||||
if (config.logToDatabase) {
|
||||
if (!lastGraphPush[network.ip] || (timeMs - lastGraphPush[network.ip] >= 60 * 1000 && res) || timeMs - lastGraphPush[network.ip] >= 70 * 1000) {
|
||||
lastGraphPush[network.ip] = timeMs;
|
||||
|
||||
@ -104,6 +105,7 @@ function pingAll() {
|
||||
timestamp: timeMs
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
})(servers[i]);
|
||||
}
|
||||
@ -161,8 +163,10 @@ function startServices() {
|
||||
});
|
||||
|
||||
client.on('requestHistoryGraph', function() {
|
||||
if (config.logToDatabase) {
|
||||
// Send them the big 24h graph.
|
||||
client.emit('historyGraph', graphData);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -188,6 +188,6 @@
|
||||
"pingAll": 2000,
|
||||
"connectTimeout": 1500
|
||||
},
|
||||
"logToDatabase": true,
|
||||
"logToDatabase": false,
|
||||
"graphDuration": 86400000
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user