added time sync for api

This commit is contained in:
cubedro 2015-06-02 03:06:11 +03:00
parent 1151bfa9dd
commit da45dfbdf9
2 changed files with 5 additions and 1 deletions

5
app.js
View File

@ -211,7 +211,10 @@ api.on('connection', function(spark) {
spark.on('node-ping', function(data)
{
spark.emit('node-pong');
spark.emit('node-pong', {
clientTime: data.clientTime,
serverTime: _.now()
});
});
spark.on('latency', function(data)

View File

@ -150,6 +150,7 @@ netStatsApp.controller('StatsCtrl', function($scope, $filter, socket, _, toastr)
break;
// TODO: Remove when everybody updates api client to 0.0.12
case "update":
var index = findIndex({id: data.id});