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