bring back connection failure counter
Otherwise, navigating between pages can, I guess, cause connection failures that take down the webapp.
This commit is contained in:
parent
2400c6faa3
commit
afacc413e1
1 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
||||||
// Maximum update frequency is controlled by #{startdelay}
|
// Maximum update frequency is controlled by #{startdelay}
|
||||||
// and #{delay}, both in milliseconds.
|
// and #{delay}, both in milliseconds.
|
||||||
|
|
||||||
$dead = 0;
|
$connfails = 0;
|
||||||
|
|
||||||
$connfailed =
|
$connfailed =
|
||||||
'<div id="modal" class="modal fade">' +
|
'<div id="modal" class="modal fade">' +
|
||||||
|
@ -31,8 +31,8 @@ $.LongPoll#{ident} = (function() {
|
||||||
numerrs=0;
|
numerrs=0;
|
||||||
},
|
},
|
||||||
'error': function(jqxhr, msg, e) {
|
'error': function(jqxhr, msg, e) {
|
||||||
if (! $dead) {
|
$connfails = $confails + 1;
|
||||||
$dead=1;
|
if (! $connfails > 3) {
|
||||||
// blocked by many browsers
|
// blocked by many browsers
|
||||||
window.close();
|
window.close();
|
||||||
$('#modal').replaceWith($connfailed);
|
$('#modal').replaceWith($connfailed);
|
||||||
|
|
Loading…
Add table
Reference in a new issue