fix(purge): short first tick on all three purge timers so daily-recycled nodes still purge
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Kpi;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Kpi;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types;
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.KpiHistory;
|
||||
|
||||
@@ -119,12 +120,15 @@ public class KpiHistoryRecorderActor : ReceiveActor, IWithTimers
|
||||
initialDelay: TimeSpan.FromSeconds(5),
|
||||
interval: _options.SampleInterval);
|
||||
|
||||
// The purge is daily and idempotent — no initial fast tick; the first sweep
|
||||
// fires after a full PurgeInterval.
|
||||
// The purge is idempotent, so it takes a short first tick (min(PurgeInterval, 5min)):
|
||||
// scheduling the first sweep a full PurgeInterval out meant a node recycled more often
|
||||
// than the interval (e.g. daily restart vs. daily cadence) would never purge
|
||||
// (arch-review 04, S9). Fast test cadences (interval < 5min) are unchanged.
|
||||
Timers.StartPeriodicTimer(
|
||||
PurgeTimerKey,
|
||||
PurgeTick.Instance,
|
||||
_options.PurgeInterval);
|
||||
initialDelay: PurgeTimerSchedule.InitialDelay(_options.PurgeInterval),
|
||||
interval: _options.PurgeInterval);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user