From b4b83ccec517b2dcebbd5130e8f33245d0cbd30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Chirico=20Indreb=C3=B8?= Date: Tue, 17 Dec 2024 12:12:53 +0100 Subject: [PATCH] Allow return home missions when queue is frozen --- backend/api/Services/MissionSchedulingService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/api/Services/MissionSchedulingService.cs b/backend/api/Services/MissionSchedulingService.cs index fb8816b4..210e7b0b 100644 --- a/backend/api/Services/MissionSchedulingService.cs +++ b/backend/api/Services/MissionSchedulingService.cs @@ -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; @@ -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;