From fe1834e6be044f0fdbe68fb34122c680f29ae04d Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Thu, 14 Mar 2013 15:52:53 -0400 Subject: Add resume capability to GetTempFile --- MediaBrowser.WebDashboard/Html/scripts/site.js | 29 ++++++++++++++------------ 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'MediaBrowser.WebDashboard/Html/scripts/site.js') diff --git a/MediaBrowser.WebDashboard/Html/scripts/site.js b/MediaBrowser.WebDashboard/Html/scripts/site.js index cb4ba3bdd..75521f9fd 100644 --- a/MediaBrowser.WebDashboard/Html/scripts/site.js +++ b/MediaBrowser.WebDashboard/Html/scripts/site.js @@ -397,23 +397,26 @@ var Dashboard = { if (!info.HasPendingRestart) { Dashboard.reloadPage(); } else { - Dashboard.reloadPageWhenServerAvailable(retryCount); + Dashboard.retryReload(retryCount); } - }).fail(function () { - - setTimeout(function () { + }).fail(function() { + Dashboard.retryReload(retryCount); + }); + }, + + retryReload: function (retryCount) { + setTimeout(function () { - retryCount = retryCount || 0; - retryCount++; + retryCount = retryCount || 0; + retryCount++; - if (retryCount < 10) { - Dashboard.reloadPageWhenServerAvailable(retryCount); - } else { - Dashboard.suppressAjaxErrors = false; - } - }, 500); - }); + if (retryCount < 10) { + Dashboard.reloadPageWhenServerAvailable(retryCount); + } else { + Dashboard.suppressAjaxErrors = false; + } + }, 500); }, getPosterViewHtml: function (options) { -- cgit v1.2.3