Explorar o código

Check service running before checking self restart

hatharry %!s(int64=9) %!d(string=hai) anos
pai
achega
71386f0ceb
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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();