main: Fix silly logic bug in the exponential backoff code
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user