Skip to content

Instantly share code, notes, and snippets.

@cybrox
Created March 20, 2019 15:34
Show Gist options
  • Save cybrox/249716d5c8e0141ab3577a909712c8ac to your computer and use it in GitHub Desktop.
Save cybrox/249716d5c8e0141ab3577a909712c8ac to your computer and use it in GitHub Desktop.
phx-ete4.ex
defp checkout_shared_db_conn do
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo, ownership_timeout: :infinity)
:ok = Ecto.Adapters.SQL.Sandbox.mode(Repo, {:shared, self()})
end
defp checkin_shared_db_conn(_) do
:ok = Ecto.Adapters.SQL.Sandbox.checkin(Repo)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment