mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-03-26 08:56:47 +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