Skip to content

Commit

Permalink
feat: change query limit to 8hours prior
Browse files Browse the repository at this point in the history
  • Loading branch information
macojaune committed Dec 21, 2024
1 parent d3369f1 commit 9b11036
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ app.get("/api/power-statuses", async (c) => {
})
.from(powerStatuses)
.where(
gte(powerStatuses.createdAt, new Date(Date.now() - 2 * 60 * 60 * 1000)),
gte(powerStatuses.createdAt, new Date(Date.now() - 8 * 60 * 60 * 1000)),
) //limit to 6 hours ago
.orderBy(desc(powerStatuses.createdAt))
.groupBy(powerStatuses.latitude, powerStatuses.longitude);
Expand Down Expand Up @@ -88,7 +88,7 @@ app.get("/api/water-statuses", async (c) => {
})
.from(waterStatuses)
.where(
gte(waterStatuses.createdAt, new Date(Date.now() - 3 * 60 * 60 * 1000)),
gte(waterStatuses.createdAt, new Date(Date.now() - 8 * 60 * 60 * 1000)),
) //limit to 6 hours ago
.orderBy(desc(waterStatuses.createdAt))
.groupBy(waterStatuses.latitude, waterStatuses.longitude);
Expand Down

0 comments on commit 9b11036

Please sign in to comment.