Skip to content

Commit e0eb900

Browse files
committed
Fix for storage_down
1 parent 7cddf9d commit e0eb900

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

lib/mongo_ecto/connection.ex

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,13 @@ defmodule Mongo.Ecto.Connection do
1313
def storage_down(opts) do
1414
opts = Keyword.put(opts, :pool, DBConnection.Connection)
1515

16-
{:ok, pid} = case Application.ensure_started(:mongodb) do
17-
:ok -> {:ok, nil}
18-
{:error, reason} -> Mongo.App.start(nil, nil)
19-
pid -> pid
20-
end
16+
{:ok, _apps} = Application.ensure_all_started(:mongodb)
2117
{:ok, conn} = Mongo.start_link(opts)
2218

2319
try do
2420
Mongo.command!(conn, dropDatabase: 1)
2521
:ok
2622
after
27-
if pid, do: Supervisor.stop(pid)
2823
GenServer.stop(conn)
2924
end
3025
end

0 commit comments

Comments
 (0)