Reduce Sleep wait interval to 1s

This commit is contained in:
Neshura 2023-07-31 23:01:52 +02:00
parent 1ee425352d
commit 0159724a7c
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -138,10 +138,11 @@ impl Bot {
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); sleep_duration = chrono::Duration::seconds(60);
} }
while Utc::now().time() - self.start_time.time() < sleep_duration { while Utc::now().time() - self.start_time.time() < sleep_duration {
sleep(time::Duration::from_secs(10)); sleep(time::Duration::from_secs(1));
} }
match reqwest::blocking::get("https://status.neshweb.net/api/push/7s1CjPPzrV?status=up&msg=OK&ping=") { match reqwest::blocking::get("https://status.neshweb.net/api/push/7s1CjPPzrV?status=up&msg=OK&ping=") {
Ok(_) => {}, Ok(_) => {},
Err(err) => println!("{}", err) Err(err) => println!("{}", err)