1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-25 23:09:22 +00:00

Cleanup is operating again

This commit is contained in:
Pierre HUBERT 2022-03-12 08:54:51 +01:00
parent 91d52695d7
commit 14fa64a04b

View File

@ -6,7 +6,7 @@
use crate::constants::{CLEAN_UP_INTERVAL, INITIAL_REFRESH_LOAD_INTERVAL}; use crate::constants::{CLEAN_UP_INTERVAL, INITIAL_REFRESH_LOAD_INTERVAL};
use crate::data::error::Res; 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 /// Start the maintenance thread
pub fn start() -> Res { pub fn start() -> Res {
@ -16,13 +16,12 @@ pub fn start() -> Res {
/// Clean up thread handler /// Clean up thread handler
fn 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); std::thread::sleep(INITIAL_REFRESH_LOAD_INTERVAL);
loop { loop {
println!("Start clean up operation"); println!("Start clean up operation");
match do_clean() { match tokio::runtime::Runtime::new().unwrap().block_on(do_clean()) {
Ok(_) => { Ok(_) => {
println!("Clean thread executed successfully!"); println!("Clean thread executed successfully!");
} }
@ -33,7 +32,7 @@ fn clean_up_thread_handler() {
} }
std::thread::sleep(CLEAN_UP_INTERVAL); std::thread::sleep(CLEAN_UP_INTERVAL);
}*/ }
} }
/// Do the cleanup /// Do the cleanup