mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-04-04 04:46:53 +00:00
Fix event loop is closed in Celery workers
This commit is contained in:
@@ -22,6 +22,8 @@ def asynctask(f):
|
||||
await database.disconnect()
|
||||
|
||||
coro = run_with_db()
|
||||
if current_task:
|
||||
return asyncio.run(coro)
|
||||
try:
|
||||
loop = asyncio.get_running_loop()
|
||||
except RuntimeError:
|
||||
|
||||
Reference in New Issue
Block a user