Ignore long-poll successes with no data

The server will occationally return successfully with no data during
a restart.  Previously, when we would get such responses, the page
would stop working because of JS errors.

(imported from commit 39b89907dc5ae9a9eb54ebf60d0069281e401786)
This commit is contained in:
Zev Benjamin 2012-10-23 11:00:00 -04:00
parent 9779ca9e5c
commit fca4cade34
1 changed files with 8 additions and 0 deletions

View File

@ -646,6 +646,14 @@ function get_updates() {
// minute to deal with crappy home wireless
// routers that kill "inactive" http connections.
success: function (data) {
if (! data) {
// The server occationally returns no data during a
// restart. Ignore those responses so the page keeps
// working
get_updates_timeout = setTimeout(get_updates, 0);
return;
}
get_updates_params.failures = 0;
$('#connection-error').hide();