Commit 6079722
authored
Clamp daemon push-sweep throttle to grace window (#83)
The onSaved retention sweep is meant to archive an aged-out previous
generation as soon as a new capture in the same page family arrives.
The fixed 5s push-sweep throttle added in #73 could swallow that sweep
when a second push lands within 5s of the first, leaving the old
generation in the listing past its grace window until the next 60m
timer sweep. This regressed daemon/scripts/e2e-smoke.mjs (onSaved
branch), which reproduced on main with retention.js unchanged.
Bound the throttle by the grace window (throttle <= grace): within the
grace window a rapid push cannot archive its predecessor anyway (it is
grace-protected), so throttling is free; once grace has elapsed the
predecessor becomes archivable and the throttle must not delay it. The
default grace (30m) far exceeds 5s, so production keeps the 5s throttle
unchanged; only an extremely short grace clamps it down.
Verified: daemon npm test 123/123, e2e-smoke green x3 (stable).1 parent 7c3fd67 commit 6079722
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
| |||
0 commit comments