Add session keep alive. If client doesn't send a keep alive, after a

specified amount of time the scheduler closes the session
This commit is contained in:
Jonathan Leibiusky (@xetorthio)
2017-10-16 18:11:15 +02:00
parent 8769aa344a
commit 1b0d363ffe
5 changed files with 43 additions and 3 deletions

View File

@@ -181,6 +181,8 @@
var socket = io({ path: '/sessions/' + sessionId + '/ws' });
socket.on('instance terminal status', function(name, status) {
var instance = $scope.idx[name];
instance.status = status;
@@ -247,8 +249,11 @@
socket.on('connect_error', function() {
$scope.connected = false;
});
socket.on('connect', function() {
socket.on('connect', function(s) {
$scope.connected = true;
setInterval(function() {
socket.emit('session keep alive', 'keep me alive please! ' + new Date());
}, 30*1000);
});
socket.on('instance stats', function(stats) {