Skip to content

Commit

Permalink
postgres: always use utc for calculating revision
Browse files Browse the repository at this point in the history
  • Loading branch information
jakedt committed Apr 13, 2022
1 parent 1a324db commit 198abd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/datastore/postgres/revisions.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
// transaction
querySelectRevision = `
SELECT COALESCE(
(SELECT MIN(%[1]s) FROM %[2]s WHERE %[3]s >= TO_TIMESTAMP(FLOOR(EXTRACT(EPOCH FROM NOW()) * 1000000000 / %[4]d) * %[4]d / 1000000000)),
(SELECT MIN(%[1]s) FROM %[2]s WHERE %[3]s >= TO_TIMESTAMP(FLOOR(EXTRACT(EPOCH FROM NOW() AT TIME ZONE 'utc') * 1000000000 / %[4]d) * %[4]d / 1000000000)),
(SELECT MAX(%[1]s) FROM %[2]s)
);`

Expand Down

0 comments on commit 198abd1

Please sign in to comment.