pub async fn settle_poll(
pool: &SqlitePool,
url: &str,
outcome: &PollOutcome,
cadence: Duration,
)Expand description
Apply a PollOutcome to the feed’s row: settle the error columns AND
reschedule it. Both halves, always, from one place.
The scheduler did this inline. web::add_subscription then copied only the
first half, so a poll taken off the scheduler could clear a stale failure’s
COUNT while leaving the feed parked on its stale backoff HORIZON — reported
healthy, not polled for up to 24h. And its failures fed consecutive_errors
with no reschedule, so repeated Subscribe clicks drove a shared feed to the
24h ceiling for every subscriber. Two copies of a sequence drift; this is
the one copy.
cadence is the interval to use on success; the scheduler derives it from
the feed’s hint, a direct caller passes the configured default. A store
failure is logged and the reschedule still attempted, so a hiccup writing
the count cannot strand the feed at a NULL next_poll that due_feeds
would then re-poll every tick.