From 373b3ab0750766ade879ea8e84e2aa828b448513 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 17 Nov 2011 23:31:40 -0800 Subject: [PATCH] Update now moves the update package to target folder, should make updates faster. --- NzbDrone.Update.Test/UpdateProviderStartFixture.cs | 8 ++++---- NzbDrone.Update/Providers/UpdateProvider.cs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Update.Test/UpdateProviderStartFixture.cs b/NzbDrone.Update.Test/UpdateProviderStartFixture.cs index 02853de30..7cfd0d73b 100644 --- a/NzbDrone.Update.Test/UpdateProviderStartFixture.cs +++ b/NzbDrone.Update.Test/UpdateProviderStartFixture.cs @@ -130,7 +130,7 @@ namespace NzbDrone.Update.Test public void should_copy_update_package_to_target() { Mocker.GetMock() - .Setup(c => c.CopyDirectory(UPDATE_FOLDER, TARGET_FOLDER)); + .Setup(c => c.MoveDirectory(UPDATE_FOLDER, TARGET_FOLDER)); Mocker.Resolve().Start(TARGET_FOLDER); } @@ -139,7 +139,7 @@ namespace NzbDrone.Update.Test public void should_restore_if_update_fails() { Mocker.GetMock() - .Setup(c => c.CopyDirectory(UPDATE_FOLDER, TARGET_FOLDER)) + .Setup(c => c.MoveDirectory(UPDATE_FOLDER, TARGET_FOLDER)) .Throws(new IOException()); //Act @@ -184,7 +184,7 @@ namespace NzbDrone.Update.Test WithServiceRunning(true); Mocker.GetMock() - .Setup(c => c.CopyDirectory(UPDATE_FOLDER, TARGET_FOLDER)) + .Setup(c => c.MoveDirectory(UPDATE_FOLDER, TARGET_FOLDER)) .Throws(new IOException()); //Act @@ -202,7 +202,7 @@ namespace NzbDrone.Update.Test WithServiceRunning(false); Mocker.GetMock() - .Setup(c => c.CopyDirectory(UPDATE_FOLDER, TARGET_FOLDER)) + .Setup(c => c.MoveDirectory(UPDATE_FOLDER, TARGET_FOLDER)) .Throws(new IOException()); //Act diff --git a/NzbDrone.Update/Providers/UpdateProvider.cs b/NzbDrone.Update/Providers/UpdateProvider.cs index 05bcc76d1..969879d77 100644 --- a/NzbDrone.Update/Providers/UpdateProvider.cs +++ b/NzbDrone.Update/Providers/UpdateProvider.cs @@ -68,11 +68,11 @@ namespace NzbDrone.Update.Providers _diskProvider.CopyDirectory(targetFolder, _enviromentProvider.GetUpdateBackUpFolder()); - logger.Info("Copying update package to target"); + logger.Info("Moving update package to target"); try { - _diskProvider.CopyDirectory(_enviromentProvider.GetUpdatePackageFolder(), targetFolder); + _diskProvider.MoveDirectory(_enviromentProvider.GetUpdatePackageFolder(), targetFolder); } catch (Exception e) {