IsoTpParallelQuery: break earlier and add comment (#27883)

* better ordering and comments

* one comment one dream
This commit is contained in:
Shane Smiskol
2023-04-11 21:05:07 -07:00
committed by GitHub
parent 02798513af
commit 74f709a59f
+4 -3
View File
@@ -100,9 +100,6 @@ class IsoTpParallelQuery:
while True:
self.rx()
if all(request_done.values()):
break
for tx_addr, msg in msgs.items():
try:
dat, rx_in_progress = msg.recv()
@@ -140,6 +137,10 @@ class IsoTpParallelQuery:
request_done[tx_addr] = True
cloudlog.error(f"iso-tp query bad response: {tx_addr} - 0x{dat.hex()}")
# Break if all requests are done, we've timed out on all requests, or we've hit a max total timeout
if all(request_done.values()):
break
cur_time = time.monotonic()
if cur_time - max(response_timeouts.values()) > 0:
for tx_addr in msgs: