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}");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,12 @@ namespace AyaNova.Biz
|
||||
{
|
||||
log.LogTrace($"DeliverSMTP deliving notify event: {ne}");
|
||||
throw new System.NotImplementedException("DeliverSMTP: NOT IMPLEMENTED YET");
|
||||
|
||||
//todo: //Open question: what to do with failed deliveries?
|
||||
//we dont' want them piling up but we don't want to just dump them do we?
|
||||
//it should be only mail ones that fail, not app ones, there's no way for an app delivery to fail as it's just put in a table
|
||||
//### PLAN if it's an smtp delivery that fails and it's to someone who can be delivered in app then it should send an inapp notification of
|
||||
//delivery failure and still delete the smtp delivery
|
||||
//If it's not possible to notify the person via in app of the failed smtp then perhaps it notifies OPS personnel and biz admin personnel
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user