bring back retry on connection fail

This commit is contained in:
Joey Hess 2012-07-30 16:24:55 -04:00
parent afacc413e1
commit 453b185c85

View file

@ -5,9 +5,9 @@
// Maximum update frequency is controlled by #{startdelay} // Maximum update frequency is controlled by #{startdelay}
// and #{delay}, both in milliseconds. // and #{delay}, both in milliseconds.
$connfails = 0; connfails=0;
$connfailed = connfailed=
'<div id="modal" class="modal fade">' + '<div id="modal" class="modal fade">' +
' <div .modal-header>' + ' <div .modal-header>' +
' <h3>git-annex has shut down</h2>' + ' <h3>git-annex has shut down</h2>' +
@ -31,13 +31,16 @@ $.LongPoll#{ident} = (function() {
numerrs=0; numerrs=0;
}, },
'error': function(jqxhr, msg, e) { 'error': function(jqxhr, msg, e) {
$connfails = $confails + 1; connfails=connfails+1;
if (! $connfails > 3) { if (connfails > 3) {
// blocked by many browsers // blocked by many browsers
window.close(); window.close();
$('#modal').replaceWith($connfailed); $('#modal').replaceWith(connfailed);
$('#modal').modal('show'); $('#modal').modal('show');
} }
else {
setTimeout($.LongPoll#{ident}.send, #{show delay});
}
}, },
}); });
} }