main: Fix silly logic bug in the exponential backoff code

This commit is contained in:
2025-05-03 16:03:01 +00:00
parent 40455f0365
commit cdb0277c57

View File

@ -38,7 +38,7 @@ use crate::{
state::FeedReaderStateDb
};
use std::{ sync::Arc, cmp::max };
use std::{ sync::Arc, cmp::min, cmp::max };
use tracing::{ info, debug, error };
use chrono::DateTime;
@ -81,7 +81,7 @@ async fn main() -> anyhow::Result<()> {
};
let feed = if feed.is_none() {
backoff = max(backoff * 2, 6 * 3600);
backoff = min(backoff * 2, 6 * 3600);
error!("Backing off for {} seconds", backoff);
sleep(Duration::from_secs(backoff)).await;
continue;