Skip to content

Commit

Permalink
Add communication reconnect delay
Browse files Browse the repository at this point in the history
  • Loading branch information
oysand committed Jan 27, 2025
1 parent 90099e2 commit 63aaf97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/isar/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/isar/state_machine/states/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 63aaf97

Please sign in to comment.