diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index a4c8633e158bed6a2a2c053e454cc75e19aeff45..8c6bfbcf1f2791f064a86b0aff88d215f6bd5568 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -197,6 +197,9 @@ function MainController(profile) { Util.unblockUI(); LayoutManager.resize(mainController.views, true); // Maybe fixes white screen on startup? + + // Keep Alive + localReference.serverFacade.scheduleKeepAlive(); }); }; diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js index 96e277604e4a4ba2387881404142543ed6e52463..60957f284c6dd2440017c1a81b38ee4085062d6f 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js @@ -184,7 +184,29 @@ function ServerFacade(openbisServer) { }); } */ - + + this.scheduleKeepAlive = function() { + var _this = this; + var TIMEOUT = 30000; //30 Seconds + + setTimeout(function(){ + _this.keepAlive(); + }, TIMEOUT); + } + + this.keepAlive = function() { + var _this = this; + mainController.openbisV3.isSessionActive().done(function(isSessionActive) { + var timeStamp = Math.floor(Date.now() / 1000); + console.log("done - " + timeStamp + " - " + isSessionActive); + _this.scheduleKeepAlive(); + }).fail(function(error) { + var timeStamp = Math.floor(Date.now() / 1000); + console.log("fail - " + timeStamp + " - ERROR"); + _this.scheduleKeepAlive(); + }); + } + this.getPersons = function(personIds, callbackFunction) { if(!mainController.openbisV3.getPersons) { return null; // In case the method doesn't exist, do nothing