-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make event handlers more deterministic #1920
base: main
Are you sure you want to change the base?
Make event handlers more deterministic #1920
Conversation
679b070
to
f32f840
Compare
); | ||
var robot = await RobotService.ReadById(e.RobotId, readOnly: true); | ||
if (robot == null) | ||
if (e.Robot == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the robot be required to be a part of the event args so this can be known to never be null?
return; | ||
} | ||
|
||
_startMissionSemaphore.WaitOne(); | ||
try | ||
{ | ||
await MissionScheduling.StartNextMissionRunIfSystemIsAvailable(robot); | ||
await MissionScheduling.StartNextMissionRunIfSystemIsAvailable(e.Robot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than passing the entire robot object, would it make sense to only pass the relevant information about the robot needed to start the next mission
@@ -573,7 +573,7 @@ private async void OnIsarBatteryUpdate(object? sender, MqttReceivedArgs mqttArgs | |||
robot.Name | |||
); | |||
EmergencyActionService.SendRobotToDock( | |||
new RobotEmergencyEventArgs(robot.Id, RobotFlotillaStatus.Recharging) | |||
new RobotEmergencyEventArgs(robot, RobotFlotillaStatus.Recharging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to pass the entire robot object, or can we only pass the relevant informations
Closes #1891
Ready for review checklist: