This commit is contained in:
@@ -43,7 +43,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
AyaNova.Api.ControllerHelpers.ApiServerState apiServerState = null;
|
||||
string BackupStatusNotification = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
BackupIsRunning = true;
|
||||
@@ -53,7 +53,8 @@ namespace AyaNova.Biz
|
||||
apiServerState.SetClosed("BACKUP RUNNING");
|
||||
var jobstartmessage = $"Starting backup job {(OnDemand ? "manual / on demand" : "scheduled") } ";
|
||||
await JobsBiz.LogJobAsync(Guid.Empty, jobstartmessage);
|
||||
BackupStatusNotification = jobstartmessage + "\n";
|
||||
|
||||
DateTime dtStartBackup=DateTime.Now;
|
||||
log.LogDebug("Backup starting");
|
||||
var DemandFileNamePrepend = OnDemand ? "manual-" : string.Empty;
|
||||
//*************
|
||||
@@ -80,7 +81,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
var ms = "Backup of database completed OK";
|
||||
log.LogDebug(ms);
|
||||
BackupStatusNotification += (ms + "\n");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -96,8 +97,7 @@ namespace AyaNova.Biz
|
||||
await JobsBiz.LogJobAsync(Guid.Empty, $"Attachments backup starting");
|
||||
FileUtil.BackupAttachments(DemandFileNamePrepend);
|
||||
var ms = "Backup of file attachments completed OK";
|
||||
log.LogDebug(ms);
|
||||
BackupStatusNotification += (ms + "\n");
|
||||
log.LogDebug(ms);
|
||||
|
||||
}
|
||||
|
||||
@@ -109,6 +109,8 @@ namespace AyaNova.Biz
|
||||
//***************
|
||||
|
||||
log.LogDebug("Backup completed");
|
||||
var duration=DateTime.Now - dtStartBackup;
|
||||
await NotifyEventProcessor.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, $"Backup completed {(OnDemand ? "manual / on demand" : "scheduled")} duration: {duration.ToString()} server re-opened");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -126,7 +128,7 @@ namespace AyaNova.Biz
|
||||
apiServerState.ResumePriorState();
|
||||
BackupIsRunning = false;
|
||||
await JobsBiz.LogJobAsync(Guid.Empty, $"Backup - fully complete, server re-opened");
|
||||
await NotifyEventProcessor.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, $"Backup completed server re-opened\nStatus:{BackupStatusNotification}");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user