File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,13 @@ start_vhost(VHost, Node) ->
183183start_vhost (VHost ) ->
184184 case rabbit_vhost :exists (VHost ) of
185185 false -> {error , {no_such_vhost , VHost }};
186- true -> supervisor2 :start_child (? MODULE , [VHost ])
186+ true ->
187+ case whereis (? MODULE ) of
188+ Pid when is_pid (Pid ) ->
189+ supervisor2 :start_child (? MODULE , [VHost ]);
190+ undefined ->
191+ {error , rabbit_vhost_sup_sup_not_running }
192+ end
187193 end .
188194
189195- spec is_vhost_alive (rabbit_types :vhost ()) -> boolean ().
@@ -221,9 +227,13 @@ save_vhost_process(VHost, VHostProcessPid) ->
221227
222228- spec lookup_vhost_sup_record (rabbit_types :vhost ()) -> # vhost_sup {} | not_found .
223229lookup_vhost_sup_record (VHost ) ->
224- case ets :lookup (? MODULE , VHost ) of
225- [] -> not_found ;
226- [# vhost_sup {} = VHostSup ] -> VHostSup
230+ case ets :info (? MODULE , name ) of
231+ ? MODULE ->
232+ case ets :lookup (? MODULE , VHost ) of
233+ [] -> not_found ;
234+ [# vhost_sup {} = VHostSup ] -> VHostSup
235+ end ;
236+ undefined -> not_found
227237 end .
228238
229239- spec vhost_sup_pid (rabbit_types :vhost ()) -> no_pid | {ok , pid ()}.
You can’t perform that action at this time.
0 commit comments