From ea2b99b23aecee18bf3869e8e58a5c371a498ed1 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 5 Jul 2018 13:44:57 +0200 Subject: [PATCH] [enh] ensure_futur does what I want --- run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index f426a64..cf99d5b 100644 --- a/run.py +++ b/run.py @@ -61,6 +61,8 @@ async def initialize_app_list(): state="scheduled", ) + asyncio.ensure_future(run_jobs()) + async def run_jobs(): print("Run jobs...") @@ -133,5 +135,4 @@ async def index(request): if __name__ == "__main__": all_index_ws = [] app.add_task(initialize_app_list()) - app.add_task(run_jobs()) app.run('localhost', port=5000, debug=True)