Force interval jobs to run on startup
This commit is contained in:
parent
f1464065b5
commit
2e1628641c
1 changed files with 6 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
import asyncio
|
||||
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
from apscheduler.triggers.interval import IntervalTrigger
|
||||
|
||||
from .todoist_assigned_issues import todoist_assigned_issues
|
||||
from .todoist_repo_prs import todoist_repo_prs
|
||||
|
@ -10,6 +11,11 @@ def create_scheduler():
|
|||
scheduler = AsyncIOScheduler()
|
||||
scheduler.add_job(todoist_assigned_issues, 'interval', minutes=15)
|
||||
scheduler.add_job(todoist_repo_prs, 'interval', minutes=15)
|
||||
|
||||
for job in scheduler.get_jobs():
|
||||
if isinstance(job.trigger, IntervalTrigger):
|
||||
scheduler.add_job(job.func)
|
||||
|
||||
return scheduler
|
||||
|
||||
|
||||
|
|
Reference in a new issue