style: only callback modules should do dynamic calls

This commit is contained in:
Kjell Winblad 2023-06-08 16:16:23 +02:00
parent b60dbbc792
commit cb3a5fdbd4
1 changed files with 5 additions and 8 deletions

View File

@ -294,14 +294,11 @@ health_check(ResId) ->
%% @doc Function called from the supervisor to actually start the server
start_link(ResId, Group, ResourceType, Config, Opts) ->
QueryMode =
case erlang:function_exported(ResourceType, query_mode, 1) of
true ->
ResourceType:query_mode(Config);
false ->
maps:get(query_mode, Opts, sync)
end,
QueryMode = emqx_resource:query_mode(
ResourceType,
Config,
Opts
),
Data = #data{
id = ResId,
group = Group,