Skip to content

Commit

Permalink
fix: mark :db_termination as shutdown (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth authored Nov 12, 2024
1 parent ed03171 commit 91fcf4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/supavisor/db_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ defmodule Supavisor.DbHandler do
end

def handle_event(_, {closed, _}, :busy, data) when closed in @sock_closed do
{:stop, :db_termination, data}
{:stop, {:shutdown, :db_termination}, data}
end

def handle_event(_, {closed, _}, state, data) when closed in @sock_closed do
Logger.error("DbHandler: Connection closed when state was #{state}")

if Application.get_env(:supavisor, :reconnect_on_db_close),
do: {:next_state, :connect, data, {:state_timeout, reconnect_timeout(data), :connect}},
else: {:stop, :db_termination, data}
else: {:stop, {:shutdown, :db_termination}, data}
end

# linked client_handler went down
Expand Down

0 comments on commit 91fcf4e

Please sign in to comment.