diff --git a/src/main.rs b/src/main.rs index 6db1c5b..3b783e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,9 @@ #![forbid(unsafe_code)] -use std::{path::{self, Path}, thread, time::Duration}; +use std::{path::Path, thread, time::Duration}; use log; -use teloxide_core::{prelude::*, types::{Recipient, UpdateKind}}; +use teloxide_core::{prelude::*, types::Recipient}; use teloxide::Bot; use tokio::fs; @@ -55,12 +55,14 @@ async fn main() { let chat = bot.get_chat(Recipient::Id(ChatId(CHAT_ID.parse::().unwrap()))).await.unwrap(); log::info!("Using chat {}", chat.title().unwrap()); - log::info!("Starting polling SCM for updates ({})", POLL_TIME); + let time = POLL_TIME.parse::().unwrap(); + + log::info!("Starting polling SCM for updates ({})", time); loop { let (new_prs, new_data) = api::get_new_prs(prs.clone(), repos.clone()).await; log::info!("Found {} new PRs", new_prs.len()); - thread::sleep(Duration::from_secs(5)); + thread::sleep(Duration::from_millis(time)); if new_prs.len() != 0 { prs = new_data;