From 6fc8ec6cbc1c436380e9630568ac3dc368ddfd0f Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 19 May 2013 17:43:16 -0700 Subject: [PATCH] more update fixes. --- .../Instrumentation/UpdateLogLayoutRenderer.cs | 2 +- NzbDrone.Update.Test/UpdateProviderStartFixture.cs | 2 -- NzbDrone.Update/Providers/UpdateProvider.cs | 10 ++++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/NzbDrone.Common/Instrumentation/UpdateLogLayoutRenderer.cs b/NzbDrone.Common/Instrumentation/UpdateLogLayoutRenderer.cs index 887afc7c9..c40e15f40 100644 --- a/NzbDrone.Common/Instrumentation/UpdateLogLayoutRenderer.cs +++ b/NzbDrone.Common/Instrumentation/UpdateLogLayoutRenderer.cs @@ -15,7 +15,7 @@ namespace NzbDrone.Common.Instrumentation public UpdateLogLayoutRenderer() { - _appData = Path.Combine(new EnvironmentProvider().GetUpdateLogFolder(), DateTime.Now.ToString("yy.MM.d-HH.mm")); + _appData = Path.Combine(new EnvironmentProvider().GetUpdateLogFolder(), DateTime.Now.ToString("yy.MM.d-HH.mm") + ".txt"); } diff --git a/NzbDrone.Update.Test/UpdateProviderStartFixture.cs b/NzbDrone.Update.Test/UpdateProviderStartFixture.cs index d01b20363..74c9ddeda 100644 --- a/NzbDrone.Update.Test/UpdateProviderStartFixture.cs +++ b/NzbDrone.Update.Test/UpdateProviderStartFixture.cs @@ -16,9 +16,7 @@ namespace NzbDrone.Update.Test { private const string UPDATE_FOLDER = @"C:\Temp\nzbdrone_update\nzbdrone\"; private const string BACKUP_FOLDER = @"C:\Temp\nzbdrone_update\nzbdrone_backup\"; - private const string SANDBOX_LOG_FOLDER = @"C:\Temp\nzbdrone_update\UpdateLogs\"; private const string TARGET_FOLDER = @"C:\NzbDrone\"; - private const string UPDATE_LOG_FOLDER = @"C:\NzbDrone\UpdateLogs\"; Mock _environmentProvider; diff --git a/NzbDrone.Update/Providers/UpdateProvider.cs b/NzbDrone.Update/Providers/UpdateProvider.cs index 139e16486..e56215fcd 100644 --- a/NzbDrone.Update/Providers/UpdateProvider.cs +++ b/NzbDrone.Update/Providers/UpdateProvider.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Linq; using NLog; using NzbDrone.Common; using IServiceProvider = NzbDrone.Common.IServiceProvider; @@ -45,7 +46,7 @@ namespace NzbDrone.Update.Providers public virtual void Start(string targetFolder) { Verify(targetFolder); - AppType appType = AppType.Normal; + var appType = AppType.Normal; logger.Info("Stopping all running services"); @@ -64,7 +65,12 @@ namespace NzbDrone.Update.Providers //TODO:Should be able to restart service if anything beyond this point fails logger.Info("Killing all running processes"); - _processProvider.KillAll(ProcessProvider.NzbDroneConsoleProcessName); + if (_processProvider.GetProcessByName(ProcessProvider.NzbDroneConsoleProcessName).Any()) + { + appType = AppType.Console; + _processProvider.KillAll(ProcessProvider.NzbDroneConsoleProcessName); + } + _processProvider.KillAll(ProcessProvider.NzbDroneProcessName); logger.Info("Creating backup of existing installation");