monitor/REST_handle.js
function () {

	var currTime = new Date();
	var overtime = (SR.Settings.INTERVAL_STAT_REPORT * 2);

	// remove servers no longer reporting
	for (var serverID in SR.Report.servers) {
		var stat = SR.Report.servers[serverID];
		
		if (!stat || !stat.reportedTime)
			continue;
		
		// server considered dead
		if (currTime - stat.reportedTime > overtime) {
			var ip_port = stat.server.IP + ':' + stat.server.port;
			LOG.sys(ip_port + ' overtime: ' + overtime + ' last: ' + stat.reportedTime);

			LOG.error('server: ' + ip_port + ' (' + stat.server.type + ') not responding after ' + overtime + ' ms, mark dead...', 'SR.Monitor');
			SR.Report.removeStat(serverID);
			
			// recycle port if it's from a local server
			if (stat.server.IP === SR.Settings.SERVER_INFO.IP) {
				LOG.warn('server is a local server, re-cycle its ports...', 'SR.Monitor');
				l_recyclePort(stat.ports);
			}
		}
	}
}
function () {

	var currTime = new Date();
	var overtime = (SR.Settings.INTERVAL_STAT_REPORT * 2);

	// remove servers no longer reporting
	for (var serverID in SR.Report.servers) {
		var stat = SR.Report.servers[serverID];
		
		if (!stat || !stat.reportedTime)
			continue;
		
		// server considered dead
		if (currTime - stat.reportedTime > overtime) {
			var ip_port = stat.server.IP + ':' + stat.server.port;
			LOG.sys(ip_port + ' overtime: ' + overtime + ' last: ' + stat.reportedTime);

			LOG.error('server: ' + ip_port + ' (' + stat.server.type + ') not responding after ' + overtime + ' ms, mark dead...', 'SR.Monitor');
			SR.Report.removeStat(serverID);
			
			// recycle port if it's from a local server
			if (stat.server.IP === SR.Settings.SERVER_INFO.IP) {
				LOG.warn('server is a local server, re-cycle its ports...', 'SR.Monitor');
				l_recyclePort(stat.ports);
			}
		}
	}
}
function ( ) { var currTime = new Date ( ) ; var overtime = ( SR . Settings . INTERVAL_STAT_REPORT * 2 ) ; // remove servers no longer reporting for ( var serverID in SR . Report . servers ) { var stat = SR . Report . servers [ serverID ] ; if ( ! stat || ! stat . reportedTime ) continue ; // server considered dead if ( currTime - stat . reportedTime > overtime ) { var ip_port = stat . server . IP + ':' + stat . server . port ; LOG . sys ( ip_port + ' overtime: ' + overtime + ' last: ' + stat . reportedTime ) ; LOG . error ( 'server: ' + ip_port + ' (' + stat . server . type + ') not responding after ' + overtime + ' ms, mark dead...' , 'SR.Monitor' ) ; SR . Report . removeStat ( serverID ) ; // recycle port if it's from a local server if ( stat . server . IP === SR . Settings . SERVER_INFO . IP ) { LOG . warn ( 'server is a local server, re-cycle its ports...' , 'SR.Monitor' ) ; l_recyclePort ( stat . ports ) ; } } } }
internal functions  periodic checking liveness of app servers
internal functions periodic checking liveness of app servers