@@ -80,17 +80,23 @@ connect({Username, Password}, VHost, Protocol, Pid, Infos) ->
8080
8181connect0 (AuthFun , VHost , Protocol , Pid , Infos ) ->
8282 case rabbit :is_running () of
83- true -> case AuthFun () of
84- {ok , User = # user {username = Username }} ->
85- notify_auth_result (Username ,
86- user_authentication_success , []),
87- connect1 (User , VHost , Protocol , Pid , Infos );
88- {refused , Username , Msg , Args } ->
89- notify_auth_result (Username ,
90- user_authentication_failure ,
91- [{error , rabbit_misc :format (Msg , Args )}]),
92- {error , {auth_failure , " Refused" }}
93- end ;
83+ true ->
84+ case whereis (rabbit_direct_client_sup ) of
85+ undefined ->
86+ {error , broker_is_booting };
87+ _ ->
88+ case AuthFun () of
89+ {ok , User = # user {username = Username }} ->
90+ notify_auth_result (Username ,
91+ user_authentication_success , []),
92+ connect1 (User , VHost , Protocol , Pid , Infos );
93+ {refused , Username , Msg , Args } ->
94+ notify_auth_result (Username ,
95+ user_authentication_failure ,
96+ [{error , rabbit_misc :format (Msg , Args )}]),
97+ {error , {auth_failure , " Refused" }}
98+ end
99+ end ;
94100 false -> {error , broker_not_found_on_node }
95101 end .
96102
0 commit comments