Skip to content

Commit

Permalink
Return {:stop, reason} from gen_statem init callback (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski authored Jul 26, 2024
1 parent 3e9ea98 commit 6756640
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/postgrex/replication_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ defmodule Postgrex.ReplicationConnection do
case handle_event(:internal, {:connect, :init}, @state, state) do
{:keep_state, state} -> {:ok, @state, state}
{:keep_state, state, actions} -> {:ok, @state, state, actions}
{:stop, _reason, _state} = stop -> stop
{:stop, reason, _state} -> {:stop, reason}
end
else
{:ok, @state, state, {:next_event, :internal, {:connect, :init}}}
Expand Down
2 changes: 1 addition & 1 deletion lib/postgrex/simple_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ defmodule Postgrex.SimpleConnection do
case handle_event(:internal, {:connect, :init}, @state, state) do
{:keep_state, state} -> {:ok, @state, state}
{:keep_state, state, actions} -> {:ok, @state, state, actions}
{:stop, _reason, _state} = stop -> stop
{:stop, reason, _state} -> {:stop, reason}
end
else
{:ok, @state, state, {:next_event, :internal, {:connect, :init}}}
Expand Down

0 comments on commit 6756640

Please sign in to comment.