diff --git a/src/cleanup_thread.rs b/src/cleanup_thread.rs index 0093ef2..76a1258 100644 --- a/src/cleanup_thread.rs +++ b/src/cleanup_thread.rs @@ -6,7 +6,7 @@ use crate::constants::{CLEAN_UP_INTERVAL, INITIAL_REFRESH_LOAD_INTERVAL}; use crate::data::error::Res; -use crate::helpers::{account_helper, comments_helper, conversations_helper, likes_helper, notifications_helper, posts_helper, user_helper, admin_log_helper}; +use crate::helpers::*; /// Start the maintenance thread pub fn start() -> Res { @@ -16,13 +16,12 @@ pub fn start() -> Res { /// Clean up thread handler fn clean_up_thread_handler() { - // TODO : uncomment - /*// Let the server start before doing cleanup + // Let the server start before doing cleanup std::thread::sleep(INITIAL_REFRESH_LOAD_INTERVAL); loop { println!("Start clean up operation"); - match do_clean() { + match tokio::runtime::Runtime::new().unwrap().block_on(do_clean()) { Ok(_) => { println!("Clean thread executed successfully!"); } @@ -33,7 +32,7 @@ fn clean_up_thread_handler() { } std::thread::sleep(CLEAN_UP_INTERVAL); - }*/ + } } /// Do the cleanup