chore: restore apps/emqx_retainer/src/emqx_retainer_sup.erl

this file, ce should be copied to ee, not the other way around
This commit is contained in:
Zaiming (Stone) Shi 2022-12-09 14:44:53 +01:00
parent f818a78d29
commit c5bbac0a23
1 changed files with 10 additions and 3 deletions

View File

@ -34,9 +34,8 @@ init([Env]) ->
type => worker,
modules => [emqx_retainer]} || not is_managed_by_modules()]}}.
%% This function is added to enterprise branch only.
%% In enterprise edition, the retainer worker may start under modules supervisor
%% so we should avoid starting it under the application root supervisor.
-ifdef(EMQX_ENTERPRISE).
is_managed_by_modules() ->
try
case supervisor:get_childspec(emqx_modules_sup, emqx_retainer) of
@ -47,3 +46,11 @@ is_managed_by_modules() ->
exit : {noproc, _} ->
false
end.
-else.
is_managed_by_modules() ->
%% always false for opensource edition
false.
-endif.