kopia lustrzana https://github.com/Yakifo/amqtt
Cleanup running task before shutdown
rodzic
96e89fb37f
commit
3bf29cff4c
|
@ -886,7 +886,7 @@ class Broker:
|
||||||
"Task failed and will be skipped: %s", task
|
"Task failed and will be skipped: %s", task
|
||||||
)
|
)
|
||||||
|
|
||||||
run_broadcast_task = self._run_broadcast(running_tasks)
|
run_broadcast_task = asyncio.Task(self._run_broadcast(running_tasks))
|
||||||
|
|
||||||
completed, _ = await asyncio.wait(
|
completed, _ = await asyncio.wait(
|
||||||
[run_broadcast_task, self._broadcast_shutdown_waiter],
|
[run_broadcast_task, self._broadcast_shutdown_waiter],
|
||||||
|
@ -896,6 +896,7 @@ class Broker:
|
||||||
# Shutdown has been triggered by the broker
|
# Shutdown has been triggered by the broker
|
||||||
# So stop the loop execution
|
# So stop the loop execution
|
||||||
if self._broadcast_shutdown_waiter in completed:
|
if self._broadcast_shutdown_waiter in completed:
|
||||||
|
run_broadcast_task.cancel()
|
||||||
break
|
break
|
||||||
|
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
|
Ładowanie…
Reference in New Issue