Skip to content

Commit

Permalink
add on system exit handler call to stop container
Browse files Browse the repository at this point in the history
fixes #35
  • Loading branch information
jarlah committed Oct 29, 2023
1 parent 801d626 commit c93a558
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ defmodule Testcontainers.Ecto do

case Container.run(config) do
{:ok, container} ->
System.at_exit(fn _ -> Testcontainers.stop_container(container.container_id) end)

{:ok, pid} = repo.start_link()

absolute_migrations_path =
Expand Down

0 comments on commit c93a558

Please sign in to comment.