case 4203

This commit is contained in:
2022-09-30 23:57:14 +00:00
parent d07e1367c8
commit 163dada504
4 changed files with 40 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ namespace AyaNova.Biz
{
private static ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("CoreJobBackup");
private static bool BackupIsRunning = false;
private const int MAXIMUM_MS_ALLOWED_FOR_PROCESSING = 5 * 60 * 1000;//wild assed guess 5 minutes maximum to run backup command, ever
private const int MAXIMUM_MS_ALLOWED_FOR_PROCESSING = 10 * 60 * 1000;//wild assed guess 10 minutes maximum to run backup command, ever
////////////////////////////////////////////////////////////////////////////////////////////////
// BACK-THE-FUCK-UP
@@ -51,7 +51,7 @@ namespace AyaNova.Biz
//LOCK DOWN SERVER
apiServerState = (AyaNova.Api.ControllerHelpers.ApiServerState)ServiceProviderProvider.Provider.GetService(typeof(AyaNova.Api.ControllerHelpers.ApiServerState));
apiServerState.SetClosed("BACKUP RUNNING");
var jobstartmessage = $"LT:Backup LT:StartJob {(OnDemand ? "manual / on demand" : "scheduled") } ";
var jobstartmessage = $"LT:Backup LT:StartJob {(OnDemand ? "manual / on demand" : "scheduled")} ";
await JobsBiz.LogJobAsync(Guid.Empty, jobstartmessage);
DateTime dtStartBackup = DateTime.Now;
@@ -114,7 +114,14 @@ namespace AyaNova.Biz
//PRUNE DATA BACKUP SETS NOT KEPT
await JobsBiz.LogJobAsync(Guid.Empty, $"LT:BackupDeleteOld");
//case 4203
#if (SUBSCRIPTION_BUILD)
FileUtil.DatabaseBackupCleanUp(1);
#else
FileUtil.DatabaseBackupCleanUp(ServerGlobalOpsSettingsCache.Backup.BackupSetsToKeep);
#endif
//v.next - COPY TO ONLINE STORAGE
//***************

View File

@@ -16,7 +16,7 @@ namespace AyaNova.Models
DateTime utcNow = DateTime.UtcNow;
Id = 1;
BackupTime = new DateTime(utcNow.Year, utcNow.Month, utcNow.Day, 23, 59, 0, DateTimeKind.Local).ToUniversalTime();
BackupSetsToKeep = 3;
BackupSetsToKeep = 1;
Active = true;
}
}