Skip to content

Commit

Permalink
fix: postgres 15 decimal in uptime query (#2294)
Browse files Browse the repository at this point in the history
* fix: postgres 15 decimal in uptime query

* chore: version bump to v1.10.8

* chore: bitnami image tag
  • Loading branch information
Ziinc authored Jan 7, 2025
1 parent a590bd7 commit 4252bf9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/elixir-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# run: mix test.typings
services:
postgres:
image: bitnami/postgresql:13.15.0
image: bitnami/postgresql:15
ports:
- 5432:5432
env:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.7
1.10.8
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
db:
image: postgres:13.4-alpine
image: postgres:15
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
Expand Down
10 changes: 7 additions & 3 deletions lib/logflare/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ defmodule Logflare.Repo do
rows: [
[uptime]
]
}}
when is_number(uptime) ->
ceil(uptime)
}} ->
if is_number(uptime) do
ceil(uptime)
else
# for postgres 15 and up
Decimal.round(uptime, 0, :ceiling)
end

{:error, _err} = err ->
Logger.warning("Could not get Postgres uptime, error: #{err}")
Expand Down

0 comments on commit 4252bf9

Please sign in to comment.