added time sync for api
This commit is contained in:
parent
1151bfa9dd
commit
da45dfbdf9
5
app.js
5
app.js
@ -211,7 +211,10 @@ api.on('connection', function(spark) {
|
|||||||
|
|
||||||
spark.on('node-ping', function(data)
|
spark.on('node-ping', function(data)
|
||||||
{
|
{
|
||||||
spark.emit('node-pong');
|
spark.emit('node-pong', {
|
||||||
|
clientTime: data.clientTime,
|
||||||
|
serverTime: _.now()
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
spark.on('latency', function(data)
|
spark.on('latency', function(data)
|
||||||
|
@ -150,6 +150,7 @@ netStatsApp.controller('StatsCtrl', function($scope, $filter, socket, _, toastr)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// TODO: Remove when everybody updates api client to 0.0.12
|
||||||
case "update":
|
case "update":
|
||||||
var index = findIndex({id: data.id});
|
var index = findIndex({id: data.id});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user