Fix coroutine scheduling when adding/removing handlers
This commit is contained in:
parent
1e546099a3
commit
633e11531a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user