移除无用日志
This commit is contained in:
parent
03105a9142
commit
462f3c10f7
@ -30,14 +30,12 @@ async fn schedule(tasks: Vec<Task>) -> Result<(), JobSchedulerError> {
|
||||
if task.cron.is_some() {
|
||||
let schedule = task.cron.as_ref().unwrap().as_str();
|
||||
if let Some(time_zone) = task.time_zone.as_ref() {
|
||||
tracing::info!("添加定时任务: {} - {}", task.cron.as_ref().unwrap(), time_zone);
|
||||
let tz: Tz = time_zone.parse().unwrap();
|
||||
let job_fun = task.job.clone();
|
||||
let _task_uuid = scheduler.add(Job::new_cron_job_async_tz(schedule, tz, move |_uuid, _l| {
|
||||
job_fun()
|
||||
})?).await?;
|
||||
} else {
|
||||
tracing::info!("添加定时任务: {}", task.cron.as_ref().unwrap());
|
||||
let job_fun = task.job.clone();
|
||||
let _task_uuid = scheduler.add(Job::new_cron_job_async(schedule, move |_uuid, _l| {
|
||||
job_fun()
|
||||
@ -45,7 +43,6 @@ async fn schedule(tasks: Vec<Task>) -> Result<(), JobSchedulerError> {
|
||||
}
|
||||
} else if task.interval.is_some() {
|
||||
let schedule = task.interval.unwrap();
|
||||
tracing::info!("添加定时任务: {}", task.interval.as_ref().unwrap());
|
||||
let job_fun = task.job.clone();
|
||||
let _task_uuid = scheduler.add(Job::new_repeated_async(Duration::from_secs(schedule), move |_uuid, _l| {
|
||||
job_fun()
|
||||
|
Loading…
Reference in New Issue
Block a user