Skip to content

Commit d00cdd7

Browse files
committed
fix: add misfire grace time and max instances to scheduled jobs
1 parent 8b071ed commit d00cdd7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/common/job/clean_chat_job.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def run():
104104
existing_job = scheduler.get_job(job_id='clean_chat_log')
105105
if existing_job is not None:
106106
existing_job.remove()
107-
scheduler.add_job(clean_chat_log_job, 'cron', hour='0', minute='5', id='clean_chat_log')
107+
scheduler.add_job(clean_chat_log_job, 'cron', hour='0', minute='5', id='clean_chat_log',
108+
misfire_grace_time=300, max_instances=1)
108109
finally:
109110
rlock.un_lock('clean_chat_log_job')

0 commit comments

Comments
 (0)