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,8 +200,12 @@ 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{
var errorct=localStorage.getItem("wserror_" + tlid)*1+1;
localStorage.setItem("wserror_" + tlid,errorct);
if(errorct<3){
reconnector(tlid,TLtype,acct_id,"","error"); reconnector(tlid,TLtype,acct_id,"","error");
} }
}
}; };
websocketLocal[wslid].onclose = function() { websocketLocal[wslid].onclose = function() {
console.error('WebSocketLocal Closing by error:' + tlid); console.error('WebSocketLocal Closing by error:' + tlid);
@ -209,8 +213,12 @@ 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{
var errorct=localStorage.getItem("wserror_" + tlid)*1+1;
localStorage.setItem("wserror_" + tlid,errorct);
if(errorct<3){
reconnector(tlid,TLtype,acct_id,"","error"); reconnector(tlid,TLtype,acct_id,"","error");
} }
}
}; };
websocketHome[wshid].onerror = function(error) { websocketHome[wshid].onerror = function(error) {
console.error('WebSocket Error ' + error); console.error('WebSocket Error ' + error);
@ -218,8 +226,12 @@ 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{
var errorct=localStorage.getItem("wserror_" + tlid)*1+1;
localStorage.setItem("wserror_" + tlid,errorct);
if(errorct<3){
reconnector(tlid,TLtype,acct_id,"","error"); reconnector(tlid,TLtype,acct_id,"","error");
} }
}
}; };
websocketHome[wshid].onclose = function() { websocketHome[wshid].onclose = function() {
console.error('WebSocketHome Closing by error:' + tlid); console.error('WebSocketHome Closing by error:' + tlid);
@ -227,8 +239,12 @@ 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{
var errorct=localStorage.getItem("wserror_" + tlid)*1+1;
localStorage.setItem("wserror_" + tlid,errorct);
if(errorct<3){
reconnector(tlid,TLtype,acct_id,"","error"); reconnector(tlid,TLtype,acct_id,"","error");
} }
}
}; };