From 1ee425352d70a7e4fc5c90738ccd6d681085fa95 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 31 Jul 2023 22:55:50 +0200 Subject: [PATCH] Sleep was set to 60 when smaller 30 rather than larger 30 --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0805df6..69d0a9c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -135,9 +135,10 @@ impl Bot { pub(crate) fn idle(&self) { let mut sleep_duration = chrono::Duration::seconds(30); - if Utc::now().time() - self.start_time.time() < sleep_duration { + if Utc::now().time() - self.start_time.time() > sleep_duration { sleep_duration = chrono::Duration::seconds(60); } + while Utc::now().time() - self.start_time.time() < sleep_duration { sleep(time::Duration::from_secs(10)); }