|
|
@@ -97,7 +97,6 @@ on_start(
|
|
|
{pool_size, PoolSize},
|
|
|
{auto_reconnect, ?AUTO_RECONNECT_INTERVAL}
|
|
|
],
|
|
|
- ok = emqx_resource:allocate_resource(InstId, pool_name, InstId),
|
|
|
case emqx_resource_pool:start(InstId, ?MODULE, Opts ++ SslOpts) of
|
|
|
ok -> {ok, #{pool_name => InstId}};
|
|
|
{error, Reason} -> {error, Reason}
|
|
|
@@ -108,12 +107,7 @@ on_stop(InstId, _State) ->
|
|
|
msg => "stopping_ldap_connector",
|
|
|
connector => InstId
|
|
|
}),
|
|
|
- case emqx_resource:get_allocated_resources(InstId) of
|
|
|
- #{pool_name := PoolName} ->
|
|
|
- emqx_resource_pool:stop(PoolName);
|
|
|
- _ ->
|
|
|
- ok
|
|
|
- end.
|
|
|
+ emqx_resource_pool:stop(InstId).
|
|
|
|
|
|
on_query(InstId, {search, Base, Filter, Attributes}, #{pool_name := PoolName} = State) ->
|
|
|
Request = {Base, Filter, Attributes},
|