From 7701f87e82ce789fba9a720ec539c79e83241b9f Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 20 May 2013 13:39:47 -0700 Subject: [PATCH] update won't fail if service can't be stopped. --- NzbDrone.Update/Providers/UpdateProvider.cs | 12 ++++++++++-- NzbDrone/Owin/OwinHostController.cs | 3 --- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/NzbDrone.Update/Providers/UpdateProvider.cs b/NzbDrone.Update/Providers/UpdateProvider.cs index 2837130c3..94e9cb71a 100644 --- a/NzbDrone.Update/Providers/UpdateProvider.cs +++ b/NzbDrone.Update/Providers/UpdateProvider.cs @@ -54,9 +54,17 @@ namespace NzbDrone.Update.Providers && _serviceProvider.IsServiceRunning(ServiceProvider.NZBDRONE_SERVICE_NAME)) { appType = AppType.Service; - _serviceProvider.Stop(ServiceProvider.NZBDRONE_SERVICE_NAME); - } + try + { + _serviceProvider.Stop(ServiceProvider.NZBDRONE_SERVICE_NAME); + + } + catch (InvalidOperationException e) + { + logger.WarnException("couldn't stop service", e); + } + } else { appType = AppType.Normal; diff --git a/NzbDrone/Owin/OwinHostController.cs b/NzbDrone/Owin/OwinHostController.cs index 2d4c56037..8a5da9ec4 100644 --- a/NzbDrone/Owin/OwinHostController.cs +++ b/NzbDrone/Owin/OwinHostController.cs @@ -1,10 +1,7 @@ using System; using System.Collections.Generic; -using System.Threading.Tasks; using Microsoft.Owin.Hosting; using NLog; -using Nancy.Bootstrapper; -using Nancy.Owin; using NzbDrone.Common; using NzbDrone.Owin.MiddleWare; using Owin;