driver: wait for the read_response task to complete before connection retry
This commit is contained in:
parent
7dd551201e
commit
2a6db53dc8
@ -773,6 +773,7 @@ class Kirdy:
|
|||||||
async def _handler(self):
|
async def _handler(self):
|
||||||
try:
|
try:
|
||||||
self._state = State.disconnected
|
self._state = State.disconnected
|
||||||
|
self.read_response_task = None
|
||||||
first_con = True
|
first_con = True
|
||||||
task = None
|
task = None
|
||||||
while True:
|
while True:
|
||||||
@ -811,6 +812,7 @@ class Kirdy:
|
|||||||
logging.warning("Connection to Kirdy is dropped.")
|
logging.warning("Connection to Kirdy is dropped.")
|
||||||
first_con = True
|
first_con = True
|
||||||
self.read_response_task.cancel()
|
self.read_response_task.cancel()
|
||||||
|
await self.read_response_task
|
||||||
|
|
||||||
# State Transition
|
# State Transition
|
||||||
self._state = State.disconnected
|
self._state = State.disconnected
|
||||||
|
Loading…
Reference in New Issue
Block a user