Check error count on integrated tl

This commit is contained in:
kPherox 2019-04-22 03:30:25 +09:00
parent a09c031dbe
commit bd8d480e07
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D

View File

@ -200,7 +200,11 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Error ' + error); todo('WebSocket Error ' + error);
}else{ }else{
reconnector(tlid,TLtype,acct_id,"","error"); var errorct=localStorage.getItem("wserror_" + tlid)*1+1;
localStorage.setItem("wserror_" + tlid,errorct);
if(errorct<3){
reconnector(tlid,TLtype,acct_id,"","error");
}
} }
}; };
websocketLocal[wslid].onclose = function() { websocketLocal[wslid].onclose = function() {
@ -209,7 +213,11 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Closed'); todo('WebSocket Closed');
}else{ }else{
reconnector(tlid,TLtype,acct_id,"","error"); var errorct=localStorage.getItem("wserror_" + tlid)*1+1;
localStorage.setItem("wserror_" + tlid,errorct);
if(errorct<3){
reconnector(tlid,TLtype,acct_id,"","error");
}
} }
}; };
websocketHome[wshid].onerror = function(error) { websocketHome[wshid].onerror = function(error) {
@ -218,7 +226,11 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Error ' + error); todo('WebSocket Error ' + error);
}else{ }else{
reconnector(tlid,TLtype,acct_id,"","error"); var errorct=localStorage.getItem("wserror_" + tlid)*1+1;
localStorage.setItem("wserror_" + tlid,errorct);
if(errorct<3){
reconnector(tlid,TLtype,acct_id,"","error");
}
} }
}; };
websocketHome[wshid].onclose = function() { websocketHome[wshid].onclose = function() {
@ -227,7 +239,11 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Closed'); todo('WebSocket Closed');
}else{ }else{
reconnector(tlid,TLtype,acct_id,"","error"); var errorct=localStorage.getItem("wserror_" + tlid)*1+1;
localStorage.setItem("wserror_" + tlid,errorct);
if(errorct<3){
reconnector(tlid,TLtype,acct_id,"","error");
}
} }
}; };