better logging in update client

pull/6/head
Keivan Beigi 10 years ago
parent a3042197c5
commit 264bb66c16

@ -33,7 +33,7 @@ namespace NzbDrone.Update
var startupArgument = new StartupContext(args);
NzbDroneLogger.Register(startupArgument, true, true);
Console.WriteLine("Starting NzbDrone Update Client");
Logger.Info("Starting NzbDrone Update Client");
X509CertificateValidationPolicy.Register();
@ -41,6 +41,8 @@ namespace NzbDrone.Update
Logger.Info("Updating NzbDrone to version {0}", BuildInfo.Version);
_container.Resolve<UpdateApp>().Start(args);
Logger.Info("Update compleded successfully");
}
catch (Exception e)
{

@ -84,17 +84,18 @@ namespace NzbDrone.Update.UpdateEngine
_backupAndRestore.Backup(installationFolder);
_backupAppData.Backup();
_logger.Info("Moving update package to target");
try
{
_logger.Info("Emptying installation folder");
_diskProvider.EmptyFolder(installationFolder);
_logger.Info("Copying new files to target folder");
_diskProvider.CopyFolder(_appFolderInfo.GetUpdatePackageFolder(), installationFolder);
}
catch (Exception e)
{
_backupAndRestore.Restore(installationFolder);
_logger.FatalException("Failed to copy upgrade package to target folder.", e);
_backupAndRestore.Restore(installationFolder);
}
}
finally

Loading…
Cancel
Save