From 14fa64a04b5dfd7f23d2b9d97ec44dacb8071f5d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 12 Mar 2022 08:54:51 +0100 Subject: [PATCH] Cleanup is operating again --- src/cleanup_thread.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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