Skip to content

Commit

Permalink
Allow return home missions when queue is frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Dec 17, 2024
1 parent 3fdb1fa commit 4cf6b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/api/Services/MissionSchedulingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task StartNextMissionRunIfSystemIsAvailable(Robot robot)
return;
}

if (robot.MissionQueueFrozen && missionRun != null && !missionRun.IsEmergencyMission())
if (robot.MissionQueueFrozen && missionRun != null && !(missionRun.IsEmergencyMission() || missionRun.IsReturnHomeMission()))
{
logger.LogInformation("Robot {robotName} was ready to start a mission but its mission queue was frozen", robot.Name);
return;
Expand Down Expand Up @@ -426,7 +426,7 @@ private async Task StartMissionRun(MissionRun queuedMissionRun, Robot robot)

private bool TheSystemIsAvailableToRunAMission(Robot robot, MissionRun missionRun)
{
if (robot.MissionQueueFrozen && missionRun.MissionRunType != MissionRunType.Emergency)
if (robot.MissionQueueFrozen && !(missionRun.IsEmergencyMission() || missionRun.IsReturnHomeMission()))
{
logger.LogInformation("Mission run {MissionRunId} was not started as the mission run queue for robot {RobotName} is frozen", missionRun.Id, robot.Name);
return false;
Expand Down

0 comments on commit 4cf6b35

Please sign in to comment.