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:
Joey Hess 2012-07-30 16:14:27 -04:00
parent 2400c6faa3
commit afacc413e1

View file

@ -5,7 +5,7 @@
// Maximum update frequency is controlled by #{startdelay}
// and #{delay}, both in milliseconds.
$dead = 0;
$connfails = 0;
$connfailed =
'<div id="modal" class="modal fade">' +
@ -31,8 +31,8 @@ $.LongPoll#{ident} = (function() {
numerrs=0;
},
'error': function(jqxhr, msg, e) {
if (! $dead) {
$dead=1;
$connfails = $confails + 1;
if (! $connfails > 3) {
// blocked by many browsers
window.close();
$('#modal').replaceWith($connfailed);