style: only callback modules should do dynamic calls
This commit is contained in:
parent
b60dbbc792
commit
cb3a5fdbd4
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue