diff --git a/src/isar/config/settings.py b/src/isar/config/settings.py index 2abef14d..2ebc4dee 100644 --- a/src/isar/config/settings.py +++ b/src/isar/config/settings.py @@ -60,6 +60,10 @@ def __init__(self) -> None: # Number of attempts to request a task status in monitor before cancelling REQUEST_STATUS_FAILURE_COUNTER_LIMIT: int = Field(default=3) + # Time allocated to reconnect when failing to retrieve status due to communication + # issues + REQUEST_STATUS_COMMUNICATION_RECONNECT_DELAY: float = Field(default=10) + # Number of attempts to stop the robot before giving up STOP_ROBOT_ATTEMPTS_LIMIT: int = Field(default=10) diff --git a/src/isar/state_machine/states/monitor.py b/src/isar/state_machine/states/monitor.py index 57f577db..132cb4be 100644 --- a/src/isar/state_machine/states/monitor.py +++ b/src/isar/state_machine/states/monitor.py @@ -87,7 +87,7 @@ def _run(self) -> None: ) status = TaskStatus.Failed else: - time.sleep(self.state_machine.sleep_time) + time.sleep(settings.REQUEST_STATUS_COMMUNICATION_RECONNECT_DELAY) continue except RobotTaskStatusException as e: