diff options
Diffstat (limited to 'src/ejabberd_sql_sup.erl')
-rw-r--r-- | src/ejabberd_sql_sup.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ejabberd_sql_sup.erl b/src/ejabberd_sql_sup.erl index 731612e53..074080f5f 100644 --- a/src/ejabberd_sql_sup.erl +++ b/src/ejabberd_sql_sup.erl @@ -52,7 +52,10 @@ start(Host) -> modules => [?MODULE]}, case supervisor:start_child(ejabberd_db_sup, Spec) of {ok, _} -> ok; - {error, {already_started, _}} -> ok; + {error, {already_started, Pid}} -> + %% Wait for the supervisor to fully start + _ = supervisor:count_children(Pid), + ok; {error, Why} = Err -> ?ERROR_MSG("Failed to start ~ts: ~p", [?MODULE, Why]), Err |