added range to history log

This commit is contained in:
cubedro 2015-04-28 15:55:33 +03:00
parent 98253b9f3f
commit ec83b07f14

8
app.js
View File

@ -65,8 +65,10 @@ api.on('connection', function(spark) {
if(Nodes.getHistory().requiresUpdate() && !askedForHistory && Nodes.canNodeUpdate(data.id)) if(Nodes.getHistory().requiresUpdate() && !askedForHistory && Nodes.canNodeUpdate(data.id))
{ {
var range = Nodes.getHistory().getHistoryRequestInterval();
console.log("asked " + data.id + " for history"); console.log("asked " + data.id + " for history");
spark.emit('history', Nodes.getHistory().getHistoryRequestInterval()); console.log('interval', range);
spark.emit('history', range);
askedForHistory = true; askedForHistory = true;
} }
@ -90,8 +92,10 @@ api.on('connection', function(spark) {
if(Nodes.getHistory().requiresUpdate() && !askedForHistory && Nodes.canNodeUpdate(data.id)) if(Nodes.getHistory().requiresUpdate() && !askedForHistory && Nodes.canNodeUpdate(data.id))
{ {
var range = Nodes.getHistory().getHistoryRequestInterval();
console.log("asked " + data.id + " for history"); console.log("asked " + data.id + " for history");
spark.emit('history', Nodes.getHistory().getHistoryRequestInterval()); console.log('interval', range);
spark.emit('history', range);
askedForHistory = true; askedForHistory = true;
} }
} }