mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(blog::components::check_update) impl consistency_guard, fix handle_create issues
This commit is contained in:
18 files changed
+392
-85
No files matched your search
@@ -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(),
|
||||
)]
|
||||
),
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user