Index: Cargo.lock ================================================================== --- Cargo.lock +++ Cargo.lock @@ -2374,18 +2374,18 @@ "reqwest 0.9.24", ] [[package]] name = "rsstg" -version = "0.2.18" +version = "0.2.19" dependencies = [ "anyhow", "async-std", "atom_syndication", "chrono", "config", - "futures 0.3.28", + "futures 0.1.31", "futures-util", "lazy_static", "regex", "reqwest 0.11.18", "rss", Index: Cargo.toml ================================================================== --- Cargo.toml +++ Cargo.toml @@ -1,8 +1,8 @@ [package] name = "rsstg" -version = "0.2.19" +version = "0.2.20" authors = ["arcade"] edition = "2021" [dependencies] anyhow = "*" Index: src/core.rs ================================================================== --- src/core.rs +++ src/core.rs @@ -135,11 +135,11 @@ _ => bail!("Unsupported or mangled content:\n{:?}\n{:#?}\n{:#?}\n", &source.url, err, status) } }; for (date, url) in posts.iter() { let post_url: Cow = match source.url_re { - Some(ref x) => sedregex::ReplaceCommand::new(x)?.execute(&source.url), + Some(ref x) => sedregex::ReplaceCommand::new(x)?.execute(url), None => url.into(), }; if let Some(exists) = sqlx::query!("select exists(select true from rsstg_post where url = $1 and source_id = $2) as exists;", &post_url, *id).fetch_one(&mut self.pool.acquire().await?).await?.exists { if ! exists { @@ -263,10 +263,11 @@ }; task::spawn(async move { if let Err(err) = clone.check(&source_id, owner, true).await { if let Err(err) = clone.send(&format!("🛑 {:?}", err), None, None).await { eprintln!("Check error: {}", err); + clone.disable(&source_id, owner).await.unwrap(); }; }; }); } } else if next_fetch - now < delay { Index: src/main.rs ================================================================== --- src/main.rs +++ src/main.rs @@ -1,11 +1,11 @@ mod command; mod core; use anyhow::Result; use async_std::task; -use futures::StreamExt; +use async_std::stream::StreamExt; fn main() -> Result<()> { let settings = config::Config::builder() .add_source(config::File::with_name("rsstg")) .build()?;