added history request/response log

pull/5/head
cubedro 10 years ago
parent bf1aed7370
commit 61b5ddd125
  1. 3
      app.js

@ -65,6 +65,7 @@ api.on('connection', function(spark) {
if(Nodes.getHistory().requiresUpdate() && !askedForHistory && Nodes.canNodeUpdate(data.id))
{
console.log("asked " + data.id + " for history");
spark.emit('history', Nodes.getHistory().getHistoryRequestInterval());
askedForHistory = true;
}
@ -89,6 +90,7 @@ api.on('connection', function(spark) {
if(Nodes.getHistory().requiresUpdate() && !askedForHistory && Nodes.canNodeUpdate(data.id))
{
console.log("asked " + data.id + " for history");
spark.emit('history', Nodes.getHistory().getHistoryRequestInterval());
askedForHistory = true;
}
@ -96,6 +98,7 @@ api.on('connection', function(spark) {
});
spark.on('history', function(data){
console.log("got history from " + data.id);
client.write({action: 'charts', data: Nodes.addHistory(data.id, data.history)});
askedForHistory = false;
});

Loading…
Cancel
Save