mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix
This commit is contained in:
@@ -193,8 +193,8 @@ impl BotsManager {
|
|||||||
// return StatusCode::UNAUTHORIZED;
|
// return StatusCode::UNAUTHORIZED;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
let t1 = routers.read().unwrap();
|
let routes = routers.read().unwrap();
|
||||||
let tx = t1.get(&token);
|
let tx = routes.get(&token);
|
||||||
|
|
||||||
let tx = match tx {
|
let tx = match tx {
|
||||||
Some(tx) => {
|
Some(tx) => {
|
||||||
@@ -272,6 +272,8 @@ impl BotsManager {
|
|||||||
|
|
||||||
manager.start_axum_server().await;
|
manager.start_axum_server().await;
|
||||||
|
|
||||||
|
let mut i = 0;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
if !running.load(Ordering::SeqCst) {
|
if !running.load(Ordering::SeqCst) {
|
||||||
manager.stop_data.0.stop();
|
manager.stop_data.0.stop();
|
||||||
@@ -281,9 +283,13 @@ impl BotsManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if i == 0 {
|
||||||
manager.check().await;
|
manager.check().await;
|
||||||
|
}
|
||||||
|
|
||||||
sleep(Duration::from_secs(30)).await;
|
sleep(Duration::from_secs(1)).await;
|
||||||
|
|
||||||
|
i = (i + 1) % 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user