Explorar el Código

Check service running before checking self restart

hatharry hace 9 años
padre
commit
71386f0ceb
Se han modificado 1 ficheros con 5 adiciones y 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();