fix(db): set time interval for influx limitations
Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user