Skip to content

Commit

Permalink
Add debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
oysand authored and haakonsf committed Jun 24, 2024
1 parent 32a82e1 commit 4053e90
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/api/Services/MissionSchedulingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ public async Task StartNextMissionRunIfSystemIsAvailable(string robotId)
logger.LogError("Failed to schedule a return to home mission for robot {RobotId}", robot.Id);
await robotService.UpdateCurrentArea(robot.Id, null);
}

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

var postReturnToHomeMissionCreatedRobot = await robotService.ReadById(missionRun.Robot.Id);
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.CurrentArea?.Name);
}

if (!await TheSystemIsAvailableToRunAMission(robot.Id, missionRun.Id))
Expand Down

0 comments on commit 4053e90

Please sign in to comment.