优化定时任务代码
This commit is contained in:
parent
3579475c9b
commit
ccb4423476
@ -33,7 +33,6 @@ async fn schedule(tasks: Vec<Arc<Task>>) -> Result<(), JobSchedulerError> {
|
|||||||
|
|
||||||
// 添加任务
|
// 添加任务
|
||||||
for task in tasks {
|
for task in tasks {
|
||||||
let task: &'static Task = Box::leak(Box::new(task));
|
|
||||||
if task.cron.is_some() {
|
if task.cron.is_some() {
|
||||||
let schedule = task.cron.as_ref().unwrap().as_str();
|
let schedule = task.cron.as_ref().unwrap().as_str();
|
||||||
if let Some(time_zone) = task.time_zone.as_ref() {
|
if let Some(time_zone) = task.time_zone.as_ref() {
|
||||||
|
Loading…
Reference in New Issue
Block a user