From e9af82c2050f2a5fab5888c061b48ff353ca3949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Chirico=20Indreb=C3=B8?= Date: Thu, 12 Dec 2024 14:49:16 +0100 Subject: [PATCH] Simplify start mission code --- backend/api/Services/MissionSchedulingService.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/backend/api/Services/MissionSchedulingService.cs b/backend/api/Services/MissionSchedulingService.cs index 3b67e96c..2d5c46b6 100644 --- a/backend/api/Services/MissionSchedulingService.cs +++ b/backend/api/Services/MissionSchedulingService.cs @@ -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 - ); } }