Per-instance interval gating in the polling loop #15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
v0.1polls every enabled instance every minute regardless ofinstances.interval_seconds. The column exists and is validated (fedi-discover:validaterejects< 1) but is currently ignored at poll time.PollFediverseAction::execute()runs unconditionally;PollInstancesCommand::handle()calls it for everyInstance::enabled()row each minute.Goal
Respect
interval_secondsper instance. Ifnow() - last_polled_at < interval_seconds, skip this tick.Acceptance criteria
PollInstancesCommand(or the action) skips an instance whenlast_polled_at + interval_seconds > now().interval_seconds=600andlast_polled_at=now()is NOT polled this minute.last_polled_at=now()-700sIS polled.last_polled_at=null(never polled) is always polled.Where the gate lives — design call
Two options:
PollFediverseAction::execute()— early return if not due. Action is the gatekeeper.PollInstancesCommand::handle()— filter theInstance::enabled()collection before iterating.B is cleaner: action stays single-purpose ("poll this instance, no questions"), command owns the scheduling concern. Pick B unless there's a reason to invert.
Out of scope
Per-instance backoff on errors (separate concern — file separately if needed).