From 9d795086870428b8e97998c4e103b14d2ffe2653 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 31 Jul 2023 22:50:48 +0200 Subject: [PATCH] Fix sleep timeout being too short --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a16a976..b009e5b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -134,7 +134,11 @@ impl Bot { } pub(crate) fn idle(&self) { - while Utc::now().time() - self.start_time.time() < chrono::Duration::seconds(30) { + let mut sleep_duration = chrono::Duration::seconds(30); + if Utc::now().time() - self.start_time.time() < sleep_duation { + sleep_duration = chrono::Duration::seconds(60); + } + while Utc::now().time() - self.start_time.time() < sleep_duration { sleep(time::Duration::from_secs(10)); } match reqwest::blocking::get("https://status.neshweb.net/api/push/7s1CjPPzrV?status=up&msg=OK&ping=") {