优化定时任务代码

This commit is contained in:
李运家 2024-10-28 20:32:18 +08:00
parent 3579475c9b
commit ccb4423476

View File

@ -33,7 +33,6 @@ async fn schedule(tasks: Vec<Arc<Task>>) -> Result<(), JobSchedulerError> {
// 添加任务
for task in tasks {
let task: &'static Task = Box::leak(Box::new(task));
if task.cron.is_some() {
let schedule = task.cron.as_ref().unwrap().as_str();
if let Some(time_zone) = task.time_zone.as_ref() {