Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct retry loop. #1729

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pymodbus/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,14 @@ async def async_execute(self, request=None):
while count < self.params.retries:
count += 1
try:
req = self._build_response(request.transaction_id)
resp = await asyncio.wait_for(
req, timeout=self.comm_params.timeout_connect
)
break
except asyncio.exceptions.TimeoutError:
pass
if count == self.params.retries:
if count > self.params.retries:
self.close(reconnect=True)
raise ModbusIOException(
f"ERROR: No response received after {self.params.retries} retries"
Expand Down