Fix coroutine scheduling when adding/removing handlers

This commit is contained in:
Dan 2019-06-23 13:56:12 +02:00
parent 1e546099a3
commit 633e11531a

View File

@ -130,7 +130,7 @@ class Dispatcher:
for lock in self.locks_list:
lock.release()
asyncio.get_event_loop().run_until_complete(fn())
asyncio.get_event_loop().create_task(fn())
def remove_handler(self, handler, group: int):
async def fn():
@ -146,7 +146,7 @@ class Dispatcher:
for lock in self.locks_list:
lock.release()
asyncio.get_event_loop().run_until_complete(fn())
asyncio.get_event_loop().create_task(fn())
async def update_worker(self, lock):
while True: