Skip to content

Commit

Permalink
Simplify start mission code
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Dec 13, 2024
1 parent dedc8d8 commit 9d1d87e
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions backend/api/Services/MissionSchedulingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,6 @@ public async Task StartNextMissionRunIfSystemIsAvailable(string robotId)
signalRService.ReportGeneralFailToSignalR(robot, $"Failed to schedule return to home for robot {robot.Name}", "");
logger.LogError("Failed to schedule a return to home mission for robot {RobotId}", robot.Id);
}

if (missionRun == null) { return; } // The robot is already home

var postReturnToHomeMissionCreatedRobot = await robotService.ReadById(missionRun.Robot.Id, readOnly: true);
if (postReturnToHomeMissionCreatedRobot == null)
{
logger.LogInformation("Could not find robot {Name}", missionRun.Robot.Name);
return;
}

logger.LogInformation(
"Post return to home mission created: Robot {robotName} has status {robotStatus} and current area {areaName}",
postReturnToHomeMissionCreatedRobot.Name,
postReturnToHomeMissionCreatedRobot.Status,
postReturnToHomeMissionCreatedRobot.CurrentInspectionArea?.Name
);
}
}

Expand Down

0 comments on commit 9d1d87e

Please sign in to comment.