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

This commit is contained in:
insistence
2024-08-07 14:41:57 +08:00
parent 5ee1a64587
commit d8e3f7dca1

View File

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