diff --git a/lms/static/js/instructor_dashboard/util.js b/lms/static/js/instructor_dashboard/util.js index 6712d6702c..3104c055e3 100644 --- a/lms/static/js/instructor_dashboard/util.js +++ b/lms/static/js/instructor_dashboard/util.js @@ -327,6 +327,7 @@ this.ms = ms; this.fn = fn; this.intervalID = null; + this.failedTries = 0; } intervalManager.prototype.start = function() { @@ -344,6 +345,15 @@ return this.intervalID; }; + intervalManager.prototype.failed_retry_threshold = 5; + + intervalManager.prototype.backOff = function() { + this.failedTries++; + if (this.failedTries >= this.failed_retry_threshold) { + this.stop(); + } + }; + return intervalManager; }()); @@ -388,6 +398,9 @@ ths.$no_tasks_message.append($('

').text(gettext('No tasks currently running.'))); return ths.$no_tasks_message.show(); } + }, + error: function() { + ths.task_poller.backOff(); } }); }; @@ -464,6 +477,9 @@ } else { return false; } + }, + error: function() { + ths.downloads_poller.backOff(); } }); };