From 56c6299417d6c8d0d0de7183327e8b9597594523 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Mon, 18 May 2026 12:33:41 +0200 Subject: [PATCH] fix(db): set time interval for influx limitations Signed-off-by: Klagarge --- db/src/rest/rest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/src/rest/rest.go b/db/src/rest/rest.go index cabcc82..568ebfa 100644 --- a/db/src/rest/rest.go +++ b/db/src/rest/rest.go @@ -111,7 +111,7 @@ func (g *RestGateway) getRoomCurrent(c *gin.Context) { roomID := c.Param("room-id") // Get the last record for the specific room - query := fmt.Sprintf(`SELECT * FROM "%s" WHERE "room" = '%s' ORDER BY time DESC LIMIT 1`, g.measurementName, roomID) + query := fmt.Sprintf(`SELECT * FROM "%s" WHERE "room" = '%s' AND time > now() - INTERVAL '1 days' ORDER BY time DESC LIMIT 1`, g.measurementName, roomID) // Using context.Background() as seen in working snippet it, err := g.influxGateway.Query(context.Background(), query)