Skip to content

Commit

Permalink
Sleep when mission is skipped, not when started
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Feb 1, 2024
1 parent c0d582e commit d772800
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/isar_exr/api/graphql_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _refresh_session(self) -> None:
)
# self.session.transport = transport
schema: GraphQLSchema = build_ast_schema(self.document)
self.client: Client = Client(transport=transport, schema=schema)
self.client = Client(transport=transport, schema=schema)
self.session = self.client.connect_sync()

def _initialize_session(self) -> None:
Expand Down
6 changes: 1 addition & 5 deletions src/isar_exr/robotinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def initiate_mission(self, mission: Mission) -> None:
poi_ids.append(existing_poi_id)

if steps_n == 0 or (steps_n == 1 and is_possible_return_to_home_mission):
time.sleep(settings.API_SLEEP_TIME)
return

if updating_site:
Expand Down Expand Up @@ -170,11 +171,6 @@ def initiate_mission(self, mission: Mission) -> None:
mission_definition_id=mission_definition_id, robot_id=settings.ROBOT_EXR_ID
)

# TODO: instead of this sleep we may want to wait until it is awake
time.sleep(
5
) # Waits for mission to start in order to avoid returning Successful to ISAR

def mission_status(self) -> MissionStatus:
try:
return self.api.get_mission_status(settings.ROBOT_EXR_ID)
Expand Down

0 comments on commit d772800

Please sign in to comment.