Skip to content

Commit

Permalink
Handle special case critical_not_alive_count==0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis-van-Gils committed Jun 12, 2024
1 parent 7e30342 commit af48c3d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/dvg_qdeviceio.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ def my_DAQ_function():
The worker will allow for up to a certain number of consecutive
communication failures with the device, before hope is given up
and a :meth:`QDeviceIO.signal_connection_lost` is emitted. Use at
your own discretion.
your own discretion. Setting the value to 0 will never give up
on communication failures.
Default: :const:`1`.
Expand Down Expand Up @@ -1345,7 +1346,10 @@ def _perform_DAQ(self):
locker.unlock()

# Check the not alive counter
if self.qdev.not_alive_counter_DAQ >= self.critical_not_alive_count:
if (
self.critical_not_alive_count > 0
and self.qdev.not_alive_counter_DAQ >= self.critical_not_alive_count
):
dprint(
f"Worker_DAQ {self.dev.name}: " f"Lost connection to device.",
ANSI.RED,
Expand Down

0 comments on commit af48c3d

Please sign in to comment.