Handle server errors better than just stopping.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 20 Nov 2013 21:39:07 +0000 (22:39 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 20 Nov 2013 21:39:07 +0000 (22:39 +0100)
www/js/remoteglot.js

index 9a2b5fd..f6b4c43 100644 (file)
@@ -17,6 +17,9 @@ var request_update = function(board) {
                ims = xhr.getResponseHeader('X-Remoteglot-Last-Modified');
                var num_viewers = xhr.getResponseHeader('X-Remoteglot-Num-Viewers');
                update_board(board, data, num_viewers);
+       }).fail(function() {
+               // Wait ten seconds, then try again.
+               setTimeout(function() { request_update(board); }, 10000);
        });
 }