This commit is contained in:
2020-07-28 17:25:45 +00:00
parent 27ecaba423
commit 5e8cf84806
4 changed files with 22 additions and 16 deletions

View File

@@ -88,7 +88,7 @@ namespace AyaNova.Biz
var msg = $"Error during data backup \"{Result}\"";
await JobsBiz.LogJobAsync(Guid.Empty, msg);
log.LogError($"BACKUP ERROR: {Result}");
await NotifyEventProcessor.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, msg);
await NotifyEventProcessor.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, msg,"Backup");
}
//DO FILE BACKUP IF ATTACHMENTS BACKED UP
@@ -110,14 +110,14 @@ namespace AyaNova.Biz
log.LogDebug("Backup completed");
var duration=DateTime.Now - dtStartBackup;
await NotifyEventProcessor.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, $"Backup ({(OnDemand ? "manual / on demand" : "scheduled")}) completed successfully, duration (h:m:s.ms): {duration.ToString()}, server re-opened");
await NotifyEventProcessor.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, $"Backup ({(OnDemand ? "manual / on demand" : "scheduled")}) completed successfully, duration (h:m:s.ms): {duration.ToString()}, server re-opened","Backup");
}
catch (Exception ex)
{
await JobsBiz.LogJobAsync(Guid.Empty, "Backup failed with errors:");
await JobsBiz.LogJobAsync(Guid.Empty, ExceptionUtil.ExtractAllExceptionMessages(ex));
log.LogError(ex, "Backup failed");
await NotifyEventProcessor.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, "Backup failed", ex);
await NotifyEventProcessor.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, "Backup failed","Backup", ex);
throw ex;
}
finally