case 4685 - backup schedule logged at Debug level when it changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 16:01:07 -07:00
parent be500d2279
commit c52273f284

View File

@@ -19,6 +19,7 @@ namespace AyaNova.Biz
{
private static ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("CoreJobBackup");
private static bool BackupIsRunning = false;
private static string LastLoggedBackupStatus = null;
private const int MAXIMUM_MS_ALLOWED_FOR_PROCESSING = 10 * 60 * 1000;//wild assed guess 10 minutes maximum to run backup command, ever
////////////////////////////////////////////////////////////////////////////////////////////////
@@ -30,11 +31,15 @@ namespace AyaNova.Biz
if (!OnDemand)
{
log.LogTrace("Checking if backup should run");
if (!ServerGlobalOpsSettingsCache.Backup.Active)
//case 4685: the schedule at Debug level, logged once each time it changes instead of on every pass
var backupStatus = ServerGlobalOpsSettingsCache.BackupStatusText();
if (backupStatus != LastLoggedBackupStatus)
{
log.LogDebug("Automatic backup is set to INACTIVE - not backing up");
return;
log.LogDebug(backupStatus);
LastLoggedBackupStatus = backupStatus;
}
if (!ServerGlobalOpsSettingsCache.Backup.Active)
return;
if (DateTime.UtcNow < ServerGlobalOpsSettingsCache.NextBackup)
{