From a9946b7b5a8c1f0aca25957124639877d488ba53 Mon Sep 17 00:00:00 2001 From: Eddasol Date: Fri, 12 Jan 2024 09:33:25 +0100 Subject: [PATCH] Fix missing pressure on new robots --- .../api/Services/ActionServices/PressureTimeseriesService.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/api/Services/ActionServices/PressureTimeseriesService.cs b/backend/api/Services/ActionServices/PressureTimeseriesService.cs index e7befd446..c36a0bb2b 100644 --- a/backend/api/Services/ActionServices/PressureTimeseriesService.cs +++ b/backend/api/Services/ActionServices/PressureTimeseriesService.cs @@ -20,9 +20,7 @@ public async Task AddPressureEntry(float pressureLevel, string isarId) return; } - if (robot.PressureLevel is null) return; - - if (Math.Abs(pressureLevel - (float)robot.PressureLevel) > Tolerance) await robotService.UpdateRobotPressureLevel(robot.Id, pressureLevel); + if (robot.PressureLevel is null || Math.Abs(pressureLevel - (float)robot.PressureLevel) > Tolerance) await robotService.UpdateRobotPressureLevel(robot.Id, pressureLevel); try { await timeseriesService.AddPressureEntry(robot.CurrentMissionId!, pressureLevel, robot.Id); } catch (NpgsqlException e)