Skip to content

Commit

Permalink
Merge pull request #169 from asmorodskyi/appscheduler_fix
Browse files Browse the repository at this point in the history
scheduler: fine tune how long job may be late for trigger appointment
  • Loading branch information
asmorodskyi authored Oct 28, 2022
2 parents 77ef7e6 + bea53b6 commit a2a5db6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ocw/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def getScheduler():
}
job_defaults = {
'coalesce': False,
'max_instances': 1,
'misfire_grace_time': 120,
'max_instances': 1
}
__scheduler = BackgroundScheduler(executors=executors, job_defaults=job_defaults, timezone=utc)
return __scheduler
Expand Down
4 changes: 2 additions & 2 deletions ocw/lib/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def list_clusters():


def init_cron():
getScheduler().add_job(cleanup_run, trigger='interval', minutes=60, id='cleanup_all')
getScheduler().add_job(list_clusters, trigger='interval', hours=18, id='list_clusters')
getScheduler().add_job(cleanup_run, trigger='interval', minutes=60, id='cleanup_all', misfire_grace_time=1800)
getScheduler().add_job(list_clusters, trigger='interval', hours=18, id='list_clusters', misfire_grace_time=10000)

0 comments on commit a2a5db6

Please sign in to comment.