diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2025-07-11 10:52:27 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2025-07-11 10:56:03 -0400 |
commit | 697c6e8d2870542f2114bb0edcf5c026ba310ffe (patch) | |
tree | 9bb2267ac1dde0c09c5bf1cde0174b7cb70b63f5 | |
parent | 2585accfeb0e8291a0d428e8d3dfc72ff8f0cec7 (diff) | |
download | kutter-697c6e8d2870542f2114bb0edcf5c026ba310ffe.tar.gz kutter-697c6e8d2870542f2114bb0edcf5c026ba310ffe.tar.xz kutter-697c6e8d2870542f2114bb0edcf5c026ba310ffe.zip |
mcu: Avoid altering self.TIMEOUT_TIME in RetryAsyncCommand
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/mcu.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py index 702f981a..8b41e4e0 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -35,16 +35,16 @@ class RetryAsyncCommand: cmd, = cmds self.serial.raw_send_wait_ack(cmd, minclock, reqclock, cmd_queue) self.min_query_time = 0. - first_query_time = query_time = self.reactor.monotonic() - if not retry: - self.TIMEOUT_TIME=.0 + timeout_time = query_time = self.reactor.monotonic() + if retry: + timeout_time += self.TIMEOUT_TIME while 1: params = self.completion.wait(query_time + self.RETRY_TIME) if params is not None: self.serial.register_response(None, self.name, self.oid) return params query_time = self.reactor.monotonic() - if query_time > first_query_time + self.TIMEOUT_TIME: + if query_time > timeout_time: self.serial.register_response(None, self.name, self.oid) raise serialhdl.error("Timeout on wait for '%s' response" % (self.name,)) |