From a7b51d9fccf8118e0dbe9b40ec0d6214de44c0d1 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 24 Sep 2023 19:48:03 +0800 Subject: [PATCH] fix bug --- app/scheduler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/scheduler.py b/app/scheduler.py index d764d3b9c..244cddd09 100644 --- a/app/scheduler.py +++ b/app/scheduler.py @@ -230,14 +230,15 @@ def list(self) -> List[schemas.ScheduleInfo]: added.append(job.name) else: continue - if not self._jobs.get(job.id): + job_id = job.id.split("|")[0] + if not self._jobs.get(job_id): continue # 任务状态 - status = "正在运行" if self._jobs[job.id].get("running") else "等待" + status = "正在运行" if self._jobs[job_id].get("running") else "等待" # 下次运行时间 next_run = TimerUtils.time_difference(job.next_run_time) schedulers.append(schemas.ScheduleInfo( - id=job.id, + id=job_id, name=job.name, status=status, next_run=next_run