improved life check on websockets
This commit is contained in:
parent
4be50cdd31
commit
69a1b7efea
|
@ -7,6 +7,7 @@ class CCPExecutionHistory extends HTMLElement {
|
|||
#data = [];
|
||||
#filtered = [];
|
||||
#socket = null;
|
||||
#interval = null;
|
||||
#searchfield = null;
|
||||
|
||||
constructor(){
|
||||
|
@ -239,8 +240,16 @@ class CCPExecutionHistory extends HTMLElement {
|
|||
if(exec){
|
||||
this.refreshExecution(exec.id)
|
||||
}
|
||||
}
|
||||
window.setInterval( ()=>this.#socket.send("ping"), 30000)
|
||||
}
|
||||
this.#interval = window.setInterval( ()=>{
|
||||
if(this.#socket.readyState === 3){
|
||||
this.#socket.close()
|
||||
window.clearInterval(this.#interval)
|
||||
this.connectBroadcast()
|
||||
}else{
|
||||
this.#socket.send("ping")
|
||||
}
|
||||
}, 30000)
|
||||
}
|
||||
|
||||
download(url, name) {
|
||||
|
|
|
@ -6,6 +6,7 @@ class CCPExecutionMonitor extends HTMLElement {
|
|||
#broadcasturl = null;
|
||||
#executions = [];
|
||||
#socket = null;
|
||||
#interval = null;
|
||||
|
||||
constructor(){
|
||||
super()
|
||||
|
@ -81,7 +82,15 @@ class CCPExecutionMonitor extends HTMLElement {
|
|||
this.refreshExecution(exec)
|
||||
}
|
||||
}
|
||||
window.setInterval( ()=>this.#socket.send("ping"), 30000)
|
||||
this.#interval = window.setInterval( ()=>{
|
||||
if(this.#socket.readyState === 3){
|
||||
this.#socket.close()
|
||||
window.clearInterval(this.#interval)
|
||||
this.connectBroadcast()
|
||||
}else{
|
||||
this.#socket.send("ping")
|
||||
}
|
||||
}, 30000)
|
||||
}
|
||||
|
||||
download(url, name) {
|
||||
|
|
|
@ -2,6 +2,7 @@ class CCPInfrastructureList extends HTMLElement{
|
|||
|
||||
#boot;
|
||||
#socket;
|
||||
#interval = null;
|
||||
#infrastructures;
|
||||
#runtimes;
|
||||
#rootdoc;
|
||||
|
@ -230,7 +231,15 @@ class CCPInfrastructureList extends HTMLElement{
|
|||
this.#socket.onmessage = event=>{
|
||||
this.fetchInfrastructures()
|
||||
}
|
||||
window.setInterval( ()=>this.#socket.send("ping"), 30000)
|
||||
this.#interval = window.setInterval( ()=>{
|
||||
if(this.#socket.readyState === 3){
|
||||
this.#socket.close()
|
||||
window.clearInterval(this.#interval)
|
||||
this.connectBroadcast()
|
||||
}else{
|
||||
this.#socket.send("ping")
|
||||
}
|
||||
}, 30000)
|
||||
}
|
||||
|
||||
getCompatibleRuntimes(rts){
|
||||
|
|
Loading…
Reference in New Issue