Fix sleep timeout being too short

This commit is contained in:
Neshura 2023-07-31 22:50:48 +02:00
parent 210ca895db
commit 9d79508687
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -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=") {