File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -84,21 +84,27 @@ qx.Class.define("osparc.WatchDog", {
8484 logo . setOnline ( value ) ;
8585 }
8686
87- if ( value ) {
88- this . __clientHeartbeatWWPinger . postMessage ( [ "start" , this . getHeartbeatInterval ( ) ] ) ;
89- } else {
90- this . __clientHeartbeatWWPinger . postMessage ( [ "stop" ] ) ;
91- }
87+ value ? this . __startPinging ( ) : this . __stopPinging ( ) ;
9288 } ,
9389
9490 __applyHeartbeatInterval : function ( value ) {
9591 if ( value === null ) {
9692 return ;
9793 }
98- this . __clientHeartbeatWWPinger . postMessage ( [ "start" , value ] ) ;
94+
95+ this . __startPinging ( ) ;
9996 this . setAppConnected ( true ) ;
10097 } ,
10198
99+ __startPinging : function ( ) {
100+ const heartbeatInterval = this . getHeartbeatInterval ( ) || 2000 ; // default to 2 seconds
101+ this . __clientHeartbeatWWPinger . postMessage ( [ "start" , heartbeatInterval ] ) ;
102+ } ,
103+
104+ __stopPinging : function ( ) {
105+ this . __clientHeartbeatWWPinger . postMessage ( [ "stop" ] ) ;
106+ } ,
107+
102108 __pingServer : function ( ) {
103109 const socket = osparc . wrapper . WebSocket . getInstance ( ) ;
104110 try {
You can’t perform that action at this time.
0 commit comments