cosmetics

This commit is contained in:
Alexey Lavrenuke 2014-10-14 20:32:19 +04:00
parent 8b9cffb5ad
commit 073f8860ee
3 changed files with 7 additions and 10 deletions

View File

@ -81,7 +81,3 @@ class ReportServer(object):
def reload(self): def reload(self):
for connection in Client.CONNECTIONS: for connection in Client.CONNECTIONS:
connection.emit('reload') connection.emit('reload')
if __name__ == "__main__":
main()

View File

@ -85,12 +85,13 @@ app.controller "TankReport", ($scope, $element) ->
'reconnection limit' : 1000 'reconnection limit' : 1000
'max reconnection attempts' : 'Infinity' 'max reconnection attempts' : 'Infinity'
) )
setInterval((
() ->conn.emit('heartbeat')
), 3000)
conn.on 'connect', () => conn.on 'connect', () =>
console.log("Connection opened...") console.log("Connection opened...")
$scope.status = "Connected" $scope.status = "Connected"
setInterval((
() ->conn.emit('heartbeat')
), 3000)
$scope.$apply() $scope.$apply()
conn.on 'disconnect', () => conn.on 'disconnect', () =>

View File

@ -154,13 +154,13 @@
'reconnection limit': 1000, 'reconnection limit': 1000,
'max reconnection attempts': 'Infinity' 'max reconnection attempts': 'Infinity'
}); });
setInterval((function() {
return conn.emit('heartbeat');
}), 3000);
conn.on('connect', (function(_this) { conn.on('connect', (function(_this) {
return function() { return function() {
console.log("Connection opened..."); console.log("Connection opened...");
$scope.status = "Connected"; $scope.status = "Connected";
setInterval((function() {
return conn.emit('heartbeat');
}), 3000);
return $scope.$apply(); return $scope.$apply();
}; };
})(this)); })(this));