more logging

This commit is contained in:
b1ek 2023-08-05 03:55:54 +10:00
parent b7003f4cb6
commit 48b9b6bc0f
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 4 additions and 0 deletions

View File

@ -79,8 +79,11 @@ pub async fn get_all_prs(repos: Vec<Repo>) -> Vec<Pull> {
*/ */
pub async fn get_new_prs(old: Vec<Pull>, repos: Vec<Repo>) -> ( Vec<Pull>, Vec<Pull> ) { pub async fn get_new_prs(old: Vec<Pull>, repos: Vec<Repo>) -> ( Vec<Pull>, Vec<Pull> ) {
log::info!("Getting all PRs now");
let data = get_all_prs(repos.clone()).await; let data = get_all_prs(repos.clone()).await;
let mut new_pulls: Vec<Pull> = vec![]; let mut new_pulls: Vec<Pull> = vec![];
for pull in data.iter() { for pull in data.iter() {
let mut alr_exists = false; let mut alr_exists = false;

View File

@ -70,6 +70,7 @@ async fn main() {
fs::write(".pr-cache", data).await.unwrap(); fs::write(".pr-cache", data).await.unwrap();
for pr in new_prs.iter() { for pr in new_prs.iter() {
log::info!("Sending message about {} ({})", pr.title, pr.url);
bot.send_message(chat.id, format!("New PR\n{} ({}#{}) by {}\n{}", pr.title, pr.head.repo.name, pr.number, pr.user.login, pr.url)).await.unwrap(); bot.send_message(chat.id, format!("New PR\n{} ({}#{}) by {}\n{}", pr.title, pr.head.repo.name, pr.number, pr.user.login, pr.url)).await.unwrap();
bot.send_message(chat.id, "апрувните пж @bleki42 @balistiktw @x3paerz").await.unwrap(); bot.send_message(chat.id, "апрувните пж @bleki42 @balistiktw @x3paerz").await.unwrap();
} }