You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2015/07/03 19:32:29 UTC
incubator-zeppelin git commit: Reintegrate Ping
Repository: incubator-zeppelin
Updated Branches:
refs/heads/master 8c7424a19 -> 94c7375ae
Reintegrate Ping
Ping feature to keep websocket was introduced in #109 .
But it was deleted during the merge of #56.
This is bringing it back
Author: Damien Corneau <co...@gmail.com>
Closes #137 from corneadoug/fix/ping and squashes the following commits:
9677c30 [Damien Corneau] Remove spaces
4ccb246 [Damien Corneau] Fix ZEPPELIN-113
Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/94c7375a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/94c7375a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/94c7375a
Branch: refs/heads/master
Commit: 94c7375aecaf9bdacf27772244b5ff4be5a6c776
Parents: 8c7424a
Author: Damien Corneau <co...@gmail.com>
Authored: Fri Jul 3 14:47:48 2015 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Fri Jul 3 10:32:24 2015 -0700
----------------------------------------------------------------------
.../components/websocketEvents/websocketEvents.factory.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/94c7375a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
index 2c01210..0757d0a 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
@@ -15,15 +15,17 @@
angular.module('zeppelinWebApp').factory('websocketEvents', function($rootScope, $websocket, baseUrlSrv) {
var websocketCalls = {};
-
+
websocketCalls.ws = $websocket(baseUrlSrv.getWebsocketProtocol() + '://' + location.hostname + ':' + baseUrlSrv.getPort());
-
+
websocketCalls.ws.onOpen(function() {
console.log('Websocket created');
$rootScope.$broadcast('setConnectedStatus', true);
+ setInterval(function(){
+ websocketCalls.sendNewEvent({op: 'PING'});
+ }, 60000);
});
-
-
+
websocketCalls.sendNewEvent = function(data) {
console.log('Send >> %o, %o', data.op, data);
websocketCalls.ws.send(JSON.stringify(data));