Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from apscheduler.schedulers.asyncio import AsyncIOScheduler
- @app.listener('before_server_start')
- async def initialize_scheduler(app, loop):
- scheduler = AsyncIOScheduler()
- scheduler.add_job(example_function, 'interval', seconds=20, max_instances=1, coalesce=True)
- scheduler.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement