소스 검색

Check service running before checking self restart

hatharry 9 년 전
부모
커밋
71386f0ceb
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      MediaBrowser.ServerApplication/MainStartup.cs

+ 5 - 1
MediaBrowser.ServerApplication/MainStartup.cs

@@ -45,7 +45,11 @@ namespace MediaBrowser.ServerApplication
         {
             var options = new StartupOptions();
             _isRunningAsService = options.ContainsOption("-service");
-            _canRestartService = CanRestartWindowsService();
+
+            if (_isRunningAsService)
+            {
+                _canRestartService = CanRestartWindowsService();
+            }
 
             var currentProcess = Process.GetCurrentProcess();