better logging in update client

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

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

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

Loading…
Cancel
Save