From da45dfbdf98f69407bc1f160f233442413e227ac Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 2 Jun 2015 03:06:11 +0300 Subject: [PATCH] added time sync for api --- app.js | 5 ++++- src/js/controllers.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 7ea9b5d..33be13b 100644 --- a/app.js +++ b/app.js @@ -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) diff --git a/src/js/controllers.js b/src/js/controllers.js index 410506a..798d434 100644 --- a/src/js/controllers.js +++ b/src/js/controllers.js @@ -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});