Add debug logs
All checks were successful
Build and push container image / build (push) Successful in 12m40s
Build and push container image / deploy (push) Successful in 34s

This commit is contained in:
toast 2024-08-16 11:42:52 +10:00
parent dfa1ae75b2
commit cb660d13f4
5 changed files with 13 additions and 22 deletions

2
Cargo.lock generated
View File

@ -1023,7 +1023,7 @@ dependencies = [
[[package]]
name = "kon"
version = "0.3.17"
version = "0.3.18"
dependencies = [
"bb8",
"bb8-postgres",

View File

@ -1,6 +1,6 @@
[package]
name = "kon"
version = "0.3.17"
version = "0.3.18"
edition = "2021"
[dependencies]

View File

@ -3,7 +3,7 @@ mod processor; // Process the feeds and send it off to Discord
mod esxi;
mod github;
mod gportal;
mod rust_msg;
mod rust;
use crate::{
Error,

View File

@ -1,4 +1,5 @@
use super::{
task_info,
task_err,
TASK_NAME,
BINARY_PROPERTIES,
@ -6,7 +7,7 @@ use super::{
esxi::esxi_embed,
github::github_embed,
gportal::gportal_embed,
rust_msg::rust_message
rust::rust_message
};
use regex::Regex;
@ -57,26 +58,20 @@ pub async fn feed_processor(ctx: &Context) {
}
if Regex::new(r"(?i)\bresolved\b").unwrap().is_match(&new_desc) {
task_info(TASK_NAME, &format!("GPortal func, replying to message id: {}", msg_id));
message.reply(&ctx.http, "This incident has been marked as resolved!").await.unwrap();
redis.del(&rkey).await.unwrap();
}
}
} else {
// If the message is invalid ID, send a new message instead
let message = channel.send_message(&ctx.http, CreateMessage::new()
.content("*Uh-oh! G-Portal is having issues!*").add_embed(embed)
).await.unwrap();
redis.set(&rkey, &message.id.to_string()).await.unwrap();
redis.expire(&rkey, 36000).await.unwrap();
}
},
Ok(None) | Err(_) => {
// If the message is not found, send a new message instead
let message = channel.send_message(&ctx.http, CreateMessage::new()
.content("*Uh-oh! G-Portal is having issues!*").add_embed(embed)
).await.unwrap();
redis.set(&rkey, &message.id.to_string()).await.unwrap();
redis.expire(&rkey, 36000).await.unwrap();
// If the message is invalid ID, send a new message instead
let message = channel.send_message(&ctx.http, CreateMessage::new()
.content("*Uh-oh! G-Portal is having issues!*").add_embed(embed)
).await.unwrap();
redis.set(&rkey, &message.id.to_string()).await.unwrap();
redis.expire(&rkey, 36000).await.unwrap();
}
}
},
@ -109,15 +104,11 @@ pub async fn feed_processor(ctx: &Context) {
}
if Regex::new(r"(?i)\bresolved\b").unwrap().is_match(&new_desc) {
task_info(TASK_NAME, &format!("GitHub func, replying to message id: {}", msg_id));
message.reply(&ctx.http, "This incident has been marked as resolved!").await.unwrap();
redis.del(&rkey).await.unwrap();
}
}
} else {
// If the message is invalid ID, send a new message instead
let message = channel.send_message(&ctx.http, CreateMessage::new().add_embed(embed)).await.unwrap();
redis.set(&rkey, &message.id.to_string()).await.unwrap();
redis.expire(&rkey, 36000).await.unwrap();
}
},
Ok(None) | Err(_) => {