1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 05:19:21 +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::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