A refresh someone asks for reads the feeds in full (#77)
Check every feed, a feed's refresh, pull to refresh and ipx fetch --force all send force, which only skipped the not-due wait: the request still carried the stored ETag and Last-Modified, so an unchanged feed answered 304 and was not read. anil-dash got no site icon from a refresh for this reason. A forced scan now drops the validators; the scheduled scan keeps them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -48,7 +48,7 @@ enum Command {
|
||||
Fetch {
|
||||
/// Only this feed id
|
||||
feed: Option<String>,
|
||||
/// Poll even when the feed is not due yet
|
||||
/// Read the feed in full now, even when it is not due and has not changed
|
||||
#[arg(long)]
|
||||
force: bool,
|
||||
},
|
||||
@@ -921,7 +921,13 @@ async fn fetch(ctx: &Arc<Ctx>, only: Option<&str>, force: bool, scope: &[String]
|
||||
};
|
||||
for sub in subs.iter().filter(|s| only.is_none_or(|o| o == s.id) && in_scope(s)) {
|
||||
let (id, feed_cfg) = (&sub.id, &sub.cfg);
|
||||
let state = ctx.db.http_state(id).await?;
|
||||
let mut state = ctx.db.http_state(id).await?;
|
||||
// A scan someone asked for reads the feed in full. With the validators it only skipped the
|
||||
// wait: a feed that had not changed answered 304 and nothing was read (#77).
|
||||
if force {
|
||||
state.etag = None;
|
||||
state.last_modified = None;
|
||||
}
|
||||
|
||||
if !force && let Some(last) = state.last_checked {
|
||||
let due = last + due_after(&cfg, feed_cfg, state.ttl_mins) as i64;
|
||||
|
||||
Reference in New Issue
Block a user