Fix sleep timeout being too short
This commit is contained in:
parent
210ca895db
commit
9d79508687
1 changed files with 5 additions and 1 deletions
|
@ -134,7 +134,11 @@ impl Bot {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn idle(&self) {
|
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));
|
sleep(time::Duration::from_secs(10));
|
||||||
}
|
}
|
||||||
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=") {
|
||||||
|
|
Loading…
Reference in a new issue