Skip to content
This repository was archived by the owner on Nov 18, 2020. It is now read-only.

Since apps have deps, we should be using ensure_all_started #92

Merged
merged 1 commit into from
Oct 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/amqp_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ start() ->
%%
%% * https://github.com/rabbitmq/rabbitmq-erlang-client/issues/72
%% * https://github.com/rabbitmq/rabbitmq-common/pull/149
application:start(syntax_tools),
application:start(compiler),
application:start(xmerl),
application:start(rabbit_common),
application:start(amqp_client).
application:ensure_all_started(rabbit_common),
{ok, _} = application:ensure_all_started(amqp_client),
ok.

%%---------------------------------------------------------------------------
%% application callbacks
Expand Down
3 changes: 2 additions & 1 deletion src/amqp_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ ensure_started() ->
ensure_started(App) ->
case is_pid(application_controller:get_master(App)) andalso amqp_sup:is_ready() of
true -> ok;
false -> case application:start(App) of
false -> case application:ensure_all_started(App) of
ok -> ok;
{ok, _} -> ok;
{error, {already_started, App}} -> ok;
{error, _} = E -> throw(E)
end
Expand Down