diff --git a/src/main.rs b/src/main.rs index 81ea9d2..23a5e81 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,21 +3,29 @@ use std::{ time::{Duration, Instant}, }; -pub mod revanced; +mod revanced; -fn main() { +#[actix_web::main] +async fn main() { let scheduler = thread::spawn(|| { let wait_time = Duration::from_secs(60 * 60 * 12); + // Tokio runtime + let rt = tokio::runtime::Builder::new_current_thread() + .enable_io() + .enable_time() + .build() + .unwrap(); + loop { let start = Instant::now(); eprintln!("Scheduler starting"); // Prepare threads - let thread_a = thread::spawn(revanced::debug); + let thread_a = thread::spawn(revanced::search); // Run threads - thread_a.join().expect("Thread A panicked"); + rt.block_on(async { thread_a.join().expect("Thread A panicked").await }); let runtime = start.elapsed();