Skip to main content

mark_feed_due

Function mark_feed_due 

Source
pub async fn mark_feed_due(
    pool: &SqlitePool,
    feed_url: &str,
    not_polled_since: &str,
) -> Result<()>
Expand description

Make a feed due for polling on the next tick.

Used when a saved article is missing from the cache: if the reader still subscribes to the feed, the poller may be able to bring the article back on its own. Clearing next_poll is the whole mechanism — due_feeds treats NULL as due — so this adds no synthetic rows and no special-case fetch path.

Rate-limited by not_polled_since, and that is not a nicety.

due_feeds treats a NULL next_poll as due immediately, so clearing it unconditionally from a page handler meant every reload of the starred view made those feeds due again — bypassing the poll interval entirely. That is outbound amplification against third-party feed origins, and it lets one reader’s feeds monopolise a poll budget that is shared and already the binding constraint on how many readers an instance can serve.

A feed polled within the window is left alone: if the article was not in the feed a minute ago, another fetch now will not find it either. The nudge is therefore worth at most one extra poll per feed per interval, which is the cadence the poller already targets.

A no-op if the URL is not a known feed.