added node cleanup refresh timeout for 1h
This commit is contained in:
parent
e6baedd6ed
commit
be4654aee7
15
app.js
15
app.js
@ -185,6 +185,21 @@ var latencyTimeout = setInterval( function ()
|
||||
client.write({ action: 'client-ping' });
|
||||
}, 5000);
|
||||
|
||||
|
||||
// Cleanup old inactive nodes
|
||||
var nodeCleanupTimeout = setInterval( function ()
|
||||
{
|
||||
client.write({
|
||||
action: 'init',
|
||||
data: Nodes.all()
|
||||
});
|
||||
|
||||
client.write({
|
||||
action: 'charts',
|
||||
data: Nodes.getCharts()
|
||||
});
|
||||
}, 1000*60);
|
||||
|
||||
// view engine setup
|
||||
app.set('views', path.join(__dirname, 'views'));
|
||||
app.set('view engine', 'jade');
|
||||
|
@ -2,7 +2,7 @@ var geoip = require('geoip-lite');
|
||||
var _ = require('lodash');
|
||||
|
||||
var MAX_HISTORY = 40;
|
||||
var MAX_INACTIVE_TIME = 1000;
|
||||
var MAX_INACTIVE_TIME = 1000*60*4;
|
||||
|
||||
var Node = function Node(data)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user