diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbf7b01..a2912a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: # Minimum and maximum supported versions - versions: [{ elixir: '1.14.0', otp: '25' }, { elixir: '1.18.0', otp: '26.2.5' }] + versions: [{ elixir: '1.14.0', otp: '25' }, { elixir: '1.19.4', otp: '28' }] steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 @@ -17,4 +17,6 @@ jobs: - run: mix deps.unlock --all # compiles and runs tests against latest versions of dependencies - run: mix deps.get - run: mix test + - if: matrix.versions.elixir == '1.19.4' + run: mix format --check-formatted - run: mix dialyzer --format github diff --git a/lib/split/sockets/pool.ex b/lib/split/sockets/pool.ex index add2881..7340d23 100644 --- a/lib/split/sockets/pool.ex +++ b/lib/split/sockets/pool.ex @@ -139,14 +139,15 @@ defmodule Split.Sockets.Pool do def handle_checkin(checkin, _from, _old_conn, {_opts, metrics_ref} = pool_state) do PoolMetrics.update(metrics_ref, {:connections_in_use, -1}) - with {:ok, conn} <- checkin, - true <- Conn.is_open?(conn) do - {:ok, conn, pool_state} - else - _ -> - Logger.debug( - "Error checking in socket #{inspect(checkin)} to the pool. Socket is closed." - ) + case checkin do + {:ok, conn} -> + {:ok, conn, pool_state} + + :closed -> + {:remove, :closed, pool_state} + + other -> + Logger.debug("Error checking in socket #{inspect(other)} to the pool. Socket is closed.") {:remove, :closed, pool_state} end diff --git a/test/test_helper.exs b/test/test_helper.exs index b158c93..2b9b62e 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1,5 +1,5 @@ ExUnit.start() -# supress logging output in the console while testing +# suppress logging output in the console while testing # we can still capture the log output in tests using `capture_log` Logger.configure_backend(:console, level: :error)