Browse Source

fix: 修复定时任务监听函数中事件没有job_id报错的问题

master
insistence 10 months ago
parent
commit
d8e3f7dca1
  1. 1
      ruoyi-fastapi-backend/config/get_scheduler.py

1
ruoyi-fastapi-backend/config/get_scheduler.py

@ -221,6 +221,7 @@ class SchedulerUtil:
if event_type == 'JobExecutionEvent' and event.exception: if event_type == 'JobExecutionEvent' and event.exception:
exception_info = str(event.exception) exception_info = str(event.exception)
status = '1' status = '1'
if hasattr(event, 'job_id'):
job_id = event.job_id job_id = event.job_id
query_job = cls.get_scheduler_job(job_id=job_id) query_job = cls.get_scheduler_job(job_id=job_id)
if query_job: if query_job:

Loading…
Cancel
Save