Skip to content

Commit 668295b

Browse files
prevent refresh() request from overlapping
1 parent 7d26571 commit 668295b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/tracker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,8 @@ var ajax_inprogress = false;
20892089

20902090
function refresh() {
20912091
if(ajax_inprogress) {
2092-
periodical = setTimeout(refresh, 2000);
2092+
clearTimeout(periodical);
2093+
periodical = setTimeout(refresh, 2000);
20932094
}
20942095

20952096
$("#stText").text("checking |");
@@ -2123,6 +2124,7 @@ function refresh() {
21232124
}
21242125
},
21252126
complete: function(request, textStatus) {
2127+
clearTimeout(periodical);
21262128
periodical = setTimeout(refresh, timer_seconds * 1000);
21272129
}
21282130
});

0 commit comments

Comments
 (0)