Skip to content

Commit

Permalink
dont stop container on system exit in ecto module
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlah committed Nov 28, 2023
1 parent 2a15d34 commit a5444b1
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions lib/ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -262,21 +262,6 @@ defmodule Testcontainers.Ecto do

case Testcontainers.start_container(config) do
{:ok, container} ->
System.at_exit(fn _ ->
if Kernel.function_exported?(repo, :stop, 0) and Process.whereis(repo) != nil do
try do
repo.stop()
catch
_ ->
Logger.log(
"Failed to stop repo #{inspect(repo)} manually. This is just a warning."
)
end
end

Testcontainers.stop_container(container.container_id)
end)

:ok =
Application.put_env(
app,
Expand Down

0 comments on commit a5444b1

Please sign in to comment.