mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
23 lines
504 B
Rust
23 lines
504 B
Rust
use std::sync::atomic::{AtomicBool, Ordering};
|
|
use std::sync::Arc;
|
|
|
|
mod bots;
|
|
mod bots_manager;
|
|
mod config;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let _guard = sentry::init(config::CONFIG.sentry_dsn.clone());
|
|
pretty_env_logger::init();
|
|
|
|
let running = Arc::new(AtomicBool::new(true));
|
|
let r = running.clone();
|
|
|
|
ctrlc::set_handler(move || {
|
|
r.store(false, Ordering::SeqCst);
|
|
})
|
|
.expect("Error setting Ctrl-C handler");
|
|
|
|
bots_manager::BotsManager::start(running).await;
|
|
}
|