fix(purge): short first tick on all three purge timers so daily-recycled nodes still purge

This commit is contained in:
Joseph Doherty
2026-07-09 09:26:42 -04:00
parent 7cd62933a6
commit b58d810dbe
5 changed files with 89 additions and 5 deletions
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration;
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
using ZB.MOM.WW.ScadaBridge.Commons.Types;
namespace ZB.MOM.WW.ScadaBridge.AuditLog.Central;
@@ -93,7 +94,10 @@ public class AuditLogPurgeActor : ReceiveActor
base.PreStart();
var interval = _purgeOptions.Interval;
_timer = Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(
initialDelay: interval,
// Short first tick (min(interval, 5min)): purges are idempotent, and using the
// full interval as the initial delay meant a daily-recycled node never purged
// (arch-review 04, S9). Fast test cadences (interval < 5min) are unchanged.
initialDelay: PurgeTimerSchedule.InitialDelay(interval),
interval: interval,
receiver: Self,
message: PurgeTick.Instance,