diff --git a/Cargo.lock b/Cargo.lock index d9f8cdb..5944ccd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1093,7 +1093,7 @@ dependencies = [ [[package]] name = "kon" -version = "0.6.1" +version = "0.6.2" dependencies = [ "kon_cmds", "kon_libs", @@ -1122,7 +1122,7 @@ dependencies = [ [[package]] name = "kon_libs" -version = "0.1.0" +version = "0.1.1" dependencies = [ "cargo_toml", "poise", @@ -1141,7 +1141,7 @@ dependencies = [ [[package]] name = "kon_tasks" -version = "0.1.0" +version = "0.1.1" dependencies = [ "feed-rs", "kon_libs", diff --git a/Cargo.toml b/Cargo.toml index 94a33ee..9a0ff27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kon" -version = "0.6.1" +version = "0.6.2" edition = "2024" [workspace] diff --git a/libs/Cargo.toml b/libs/Cargo.toml index 1a714e7..b5e7fe6 100644 --- a/libs/Cargo.toml +++ b/libs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kon_libs" -version = "0.1.0" +version = "0.1.1" edition = "2024" [dependencies] diff --git a/libs/src/config.rs b/libs/src/config.rs index 6df28b1..60e3833 100644 --- a/libs/src/config.rs +++ b/libs/src/config.rs @@ -26,7 +26,7 @@ impl ConfigMeta { Self { env: "prod".to_string(), embed_color: 0x5A99C7, - ready_notify: 865673694184996888, + ready_notify: 1268493237912604672, rss_channel: 865673694184996888, kon_logs: 1268493237912604672, developers: vec![ diff --git a/tasks/Cargo.toml b/tasks/Cargo.toml index 8e2f675..4b87fcf 100644 --- a/tasks/Cargo.toml +++ b/tasks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kon_tasks" -version = "0.1.0" +version = "0.1.1" edition = "2024" [dependencies] diff --git a/tasks/src/rss/github.rs b/tasks/src/rss/github.rs index 7017ca1..951e16c 100644 --- a/tasks/src/rss/github.rs +++ b/tasks/src/rss/github.rs @@ -9,6 +9,7 @@ use super::{ parse, save_to_redis, task_err, + task_info, trim_old_content }; @@ -94,6 +95,7 @@ impl RSSFeed for GitHub { IncidentColorMap::Default.color() }; + task_info("RSS:GitHub:Debug", &format!("Checking cache for incident ID: {}", &article.links[0].href)); if cached_incident.is_empty() { save_to_redis(rkey, &get_incident_id(&article.links[0].href).unwrap()).await?; save_to_redis(&rkey_content, &new_content).await?; @@ -108,6 +110,7 @@ impl RSSFeed for GitHub { } else { redis.set(&rkey_content, &new_content).await.unwrap(); redis.expire(&rkey_content, 21600).await.unwrap(); + task_info("RSS:GitHub:Debug", "Incident added in cache and preparing to send embed to Discord"); Ok(Some(RSSFeedOutput::IncidentEmbed(embed( color, @@ -120,6 +123,7 @@ impl RSSFeed for GitHub { } else { save_to_redis(rkey, &incident).await?; redis.set(&rkey_content, &new_content).await.unwrap(); + task_info("RSS:GitHub:Debug", "Incident updated in cache and preparing to send embed to Discord"); Ok(Some(RSSFeedOutput::IncidentEmbed(embed( color, diff --git a/tasks/src/rss/processor.rs b/tasks/src/rss/processor.rs index 1dfaf46..c164308 100644 --- a/tasks/src/rss/processor.rs +++ b/tasks/src/rss/processor.rs @@ -20,11 +20,7 @@ use { Http }, regex::Regex, - std::sync::Arc, - tokio::time::{ - Duration, - sleep - } + std::sync::Arc }; // This is for building up the embed with the feed data @@ -79,9 +75,7 @@ async fn process_incident_embed( message.edit(http, EditMessage::new().embed(embed)).await?; } - sleep(Duration::from_secs(15)).await; - - if Regex::new(r"(?i)\bresolved\b").unwrap().is_match(&new_description) { + if Regex::new(r"(?i)^Resolved\s*-").unwrap().is_match(&new_description) { redis.del(redis_key).await?; } }