|
@@ -16,7 +16,7 @@ function reloadPage(){
|
|
|
location.reload()
|
|
|
}
|
|
|
|
|
|
-let Queue = {THRESHOLD: 1000, IS_LOADED : false, nowuse : 0, SVR_URL:"http://localhost:8803/server/", groupsCount : 0, groups:[], shouldStop : false, backup:["http://localhost:8803/server/","/server/","http://172.30.84.3:8803/server/","https://1.niimei.com/server/"] ,list:[]};
|
|
|
+let Queue = {THRESHOLD: 1000, IS_LOADED : false, nowuse : 0, SVR_URL:"http://localhost:8803/server/", groupsCount : 0, groups:[], shouldStop : false, backup:["http://localhost:8803/server/","/server/","http://172.30.84.3:8803/server/","https://1.niimei.com/server/"] ,list:[], temporary:0, errorCount:0};
|
|
|
let Users = {list : []};
|
|
|
let Sectors = {list : []};
|
|
|
|
|
@@ -86,11 +86,15 @@ function group_get_data(groupName, url, callback){
|
|
|
|
|
|
function parse_queue(){
|
|
|
console.log("Queue Length : " + Queue.list.length);
|
|
|
- if(Queue.list.length > 15){
|
|
|
+
|
|
|
+ if(Queue.temporary > new Date().getTime()){
|
|
|
for(i = 0; i < Queue.list.length; i++) {
|
|
|
Queue.list.pop();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ Queue.temporary = 0;
|
|
|
+
|
|
|
if(Queue.list.length > 0){
|
|
|
let one = Queue.list.pop();
|
|
|
if(one.gid === -1) {
|
|
@@ -173,6 +177,12 @@ function check_if_success(a,b){
|
|
|
}
|
|
|
|
|
|
function on_fail(msg) {
|
|
|
+ Queue.errorCount += 1;
|
|
|
+ if(Queue.errorCount >= 10){
|
|
|
+ Queue.errorCount = 0;
|
|
|
+ Queue.temporary = new Date().getTime() + 60*1000;
|
|
|
+ console.warn("----- Too many failure, temporary stop HTTP ------");
|
|
|
+ }
|
|
|
send_alert("很抱歉,网络错误,请查看Console");
|
|
|
console.warn("----- 网络请求失败 ---------");
|
|
|
console.warn(JSON.stringify(this));
|