diff options
| author | Luke <luke.pulverenti@gmail.com> | 2014-07-19 18:46:41 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2014-07-19 18:46:41 -0400 |
| commit | bcaadd59bee2852303fbe991589f22ae75eca50c (patch) | |
| tree | cbd39f318e18d8cd6b7d45a8c326f55c9383f2b0 | |
| parent | 880fa216744340db2843c4f773664426ff8bfe36 (diff) | |
| parent | b2550f6dd34bea58226aee4b1c4fa26104b5cda9 (diff) | |
Merge pull request #875 from simplement-e/master
Changed the service startup process not to wait for init
| -rw-r--r-- | MediaBrowser.ServerApplication/MainStartup.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index 9e31fc800..4c81716ed 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -224,23 +224,23 @@ namespace MediaBrowser.ServerApplication // Not crazy about this but it's the only way to suppress ffmpeg crash dialog boxes SetErrorMode(ErrorModes.SEM_FAILCRITICALERRORS | ErrorModes.SEM_NOALIGNMENTFAULTEXCEPT | ErrorModes.SEM_NOGPFAULTERRORBOX | ErrorModes.SEM_NOOPENFILEERRORBOX); - } - - var task = _appHost.Init(initProgress); - Task.WaitAll(task); - - task = _appHost.RunStartupTasks(); - Task.WaitAll(task); - - SystemEvents.SessionEnding += SystemEvents_SessionEnding; - SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; + }
+
+
+ var task = _appHost.Init(initProgress);
+ task = task.ContinueWith(new Action<Task>(a => _appHost.RunStartupTasks()));
if (runService) - { + {
StartService(logManager); } else - { + {
+ Task.WaitAll(task);
+
+ SystemEvents.SessionEnding += SystemEvents_SessionEnding;
+ SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
+ HideSplashScreen(); ShowTrayIcon(); |
