Skip to content

Commit

Permalink
trap exits
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski authored Oct 14, 2023
1 parent 02c38b6 commit a844196
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/myxql/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ defmodule MyXQL.Connection do

@impl true
def connect(opts) do
# Trap exits so that DBConnection calls `disconnect` on unexpected shutdowns
Process.flag(:trap_exit, true)

prepare = Keyword.get(opts, :prepare, :named)
ping_timeout = Keyword.get(opts, :ping_timeout, 15_000)
config = Client.Config.new(opts)
Expand Down

0 comments on commit a844196

Please sign in to comment.