Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. from apscheduler.schedulers.asyncio import AsyncIOScheduler
  2.  
  3. @app.listener('before_server_start')
  4. async def initialize_scheduler(app, loop):
  5. scheduler = AsyncIOScheduler()
  6. scheduler.add_job(example_function, 'interval', seconds=20, max_instances=1, coalesce=True)
  7. scheduler.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement