Skip to content

Commit

Permalink
Avoid database write conflicts for robots
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Jan 2, 2025
1 parent 1c892d5 commit 679b070
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/api.test/Services/RobotService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public async Task Read()
);
var installation = await _databaseUtilities.ReadOrNewInstallation();
var robot = await _databaseUtilities.NewRobot(RobotStatus.Available, installation);
var robotById = await robotService.ReadById(robot.Id, readOnly: false);
var robotById = await robotService.ReadById(robot.Id, readOnly: true);
Assert.NotNull(robotById);
Assert.Equal(robot.Id, robotById.Id);
}
Expand Down
2 changes: 1 addition & 1 deletion backend/api/Services/RobotService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ private async Task UpdateRobotProperty(
bool isLogLevelDebug = false
)
{
var robot = await ReadById(robotId, readOnly: false);
var robot = await ReadById(robotId, readOnly: true);
if (robot is null)
{
string errorMessage = $"Robot with ID {robotId} was not found in the database";
Expand Down

0 comments on commit 679b070

Please sign in to comment.