Update now moves the update package to target folder, should make updates faster.

This commit is contained in:
kay.one 2011-11-17 23:31:40 -08:00
parent 950b2f0965
commit 373b3ab075
2 changed files with 6 additions and 6 deletions

View File

@ -130,7 +130,7 @@ namespace NzbDrone.Update.Test
public void should_copy_update_package_to_target() public void should_copy_update_package_to_target()
{ {
Mocker.GetMock<DiskProvider>() Mocker.GetMock<DiskProvider>()
.Setup(c => c.CopyDirectory(UPDATE_FOLDER, TARGET_FOLDER)); .Setup(c => c.MoveDirectory(UPDATE_FOLDER, TARGET_FOLDER));
Mocker.Resolve<UpdateProvider>().Start(TARGET_FOLDER); Mocker.Resolve<UpdateProvider>().Start(TARGET_FOLDER);
} }
@ -139,7 +139,7 @@ namespace NzbDrone.Update.Test
public void should_restore_if_update_fails() public void should_restore_if_update_fails()
{ {
Mocker.GetMock<DiskProvider>() Mocker.GetMock<DiskProvider>()
.Setup(c => c.CopyDirectory(UPDATE_FOLDER, TARGET_FOLDER)) .Setup(c => c.MoveDirectory(UPDATE_FOLDER, TARGET_FOLDER))
.Throws(new IOException()); .Throws(new IOException());
//Act //Act
@ -184,7 +184,7 @@ namespace NzbDrone.Update.Test
WithServiceRunning(true); WithServiceRunning(true);
Mocker.GetMock<DiskProvider>() Mocker.GetMock<DiskProvider>()
.Setup(c => c.CopyDirectory(UPDATE_FOLDER, TARGET_FOLDER)) .Setup(c => c.MoveDirectory(UPDATE_FOLDER, TARGET_FOLDER))
.Throws(new IOException()); .Throws(new IOException());
//Act //Act
@ -202,7 +202,7 @@ namespace NzbDrone.Update.Test
WithServiceRunning(false); WithServiceRunning(false);
Mocker.GetMock<DiskProvider>() Mocker.GetMock<DiskProvider>()
.Setup(c => c.CopyDirectory(UPDATE_FOLDER, TARGET_FOLDER)) .Setup(c => c.MoveDirectory(UPDATE_FOLDER, TARGET_FOLDER))
.Throws(new IOException()); .Throws(new IOException());
//Act //Act

View File

@ -68,11 +68,11 @@ namespace NzbDrone.Update.Providers
_diskProvider.CopyDirectory(targetFolder, _enviromentProvider.GetUpdateBackUpFolder()); _diskProvider.CopyDirectory(targetFolder, _enviromentProvider.GetUpdateBackUpFolder());
logger.Info("Copying update package to target"); logger.Info("Moving update package to target");
try try
{ {
_diskProvider.CopyDirectory(_enviromentProvider.GetUpdatePackageFolder(), targetFolder); _diskProvider.MoveDirectory(_enviromentProvider.GetUpdatePackageFolder(), targetFolder);
} }
catch (Exception e) catch (Exception e)
{ {