diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-13 16:23:46 -0400 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-13 16:23:46 -0400 |
| commit | 3dc9cacfad034b11e8ddfb37b24b15499190c6bf (patch) | |
| tree | aadfc967712bcf6e8c191decb4a225630625dea2 | |
| parent | 3303f30f8ab751234b8c85ad1915f53d6ae64a14 (diff) | |
#51 - Restart the server took long time, and dashboard will die
| -rw-r--r-- | MediaBrowser.ServerApplication/App.xaml.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/Html/scripts/site.js | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/MediaBrowser.ServerApplication/App.xaml.cs b/MediaBrowser.ServerApplication/App.xaml.cs index 0155d0c90..35f203a62 100644 --- a/MediaBrowser.ServerApplication/App.xaml.cs +++ b/MediaBrowser.ServerApplication/App.xaml.cs @@ -134,6 +134,11 @@ namespace MediaBrowser.ServerApplication Logger.ErrorException("UnhandledException", exception); MessageBox.Show("Unhandled exception: " + exception.Message); + + if (!Debugger.IsAttached) + { + Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception)); + } } /// <summary> diff --git a/MediaBrowser.WebDashboard/Html/scripts/site.js b/MediaBrowser.WebDashboard/Html/scripts/site.js index 7ecaff85b..cb4ba3bdd 100644 --- a/MediaBrowser.WebDashboard/Html/scripts/site.js +++ b/MediaBrowser.WebDashboard/Html/scripts/site.js @@ -382,7 +382,7 @@ var Dashboard = { setTimeout(function () {
Dashboard.reloadPageWhenServerAvailable();
- }, 500);
+ }, 250);
}).fail(function () {
Dashboard.suppressAjaxErrors = false;
@@ -391,10 +391,17 @@ var Dashboard = { reloadPageWhenServerAvailable: function (retryCount) {
- ApiClient.getSystemInfo().done(function () {
- Dashboard.reloadPage();
+ ApiClient.getSystemInfo().done(function (info) {
+
+ // If this is back to false, the restart completed
+ if (!info.HasPendingRestart) {
+ Dashboard.reloadPage();
+ } else {
+ Dashboard.reloadPageWhenServerAvailable(retryCount);
+ }
}).fail(function () {
+
setTimeout(function () {
retryCount = retryCount || 0;
|
