feat(blog::components::check_update) impl consistency_guard, fix handle_create issues

This commit is contained in:
lumither committed 2025-04-17 23:40:30 -07:00
1 parent 71af26a09c
commit e83cea1d42
18 files changed
+392 -85

No files matched your search

+18 -8
View File
@@ -1,8 +1,6 @@
mod api;
mod components;
use crate::modules::blog::components::check_update;
use crate::scheduler::tasks::async_basic::AsyncBasic;
use crate::{
modules::{
Module,
@@ -12,10 +10,10 @@ use crate::{
get_post,
// get_post_list::get_post_list,
},
// cron::check_update,
components::{check_update, consistency_guard}, // cron::check_update,
},
},
scheduler::tasks::CronTask,
scheduler::tasks::{CronTask, async_basic::AsyncBasic},
};
use axum::{Router, routing::get};
@@ -45,11 +43,23 @@ impl Module for Blog {
fn get_cron_tasks(&self) -> Vec<(&str, Box<dyn CronTask>)> {
let db_handler = self.db_handler.clone();
vec![(
"Blog Check Update",
AsyncBasic::new(check_update::task(db_handler.clone()), "*/5 * * * * *")
vec![
(
"Blog Check Update",
AsyncBasic::new(check_update::task(db_handler.clone()), "*/5 * * * * *")
.unwrap()
.to_task(),
),
(
"Consistency Guard",
AsyncBasic::new(
consistency_guard::task(db_handler.clone()),
// "*/15 * * * * *",
"*/15 * * * * *",
)
.unwrap()
.to_task(),
)]
),
]
}
}