fix scheduler list

This commit is contained in:
jxxghp 2023-07-12 08:20:50 +08:00
parent 5e47baa4c8
commit df275c16ba

View File

@ -90,11 +90,15 @@ def schedule(_: schemas.TokenPayload = Depends(verify_token)) -> Any:
continue
if not StringUtils.is_chinese(job.name):
continue
if not job.next_run_time:
status = "已停止"
next_run = ""
else:
next_run = TimerUtils.time_difference(job.next_run_time)
if not next_run:
status = "已停止"
status = "正在运行"
else:
status = "等待" if job.pending else "运行中"
status = "阻塞" if job.pending else "等待"
schedulers.append(schemas.ScheduleInfo(
id=job.id,
name=job.name,