chore: update changes

This commit is contained in:
JianBo He 2023-06-01 15:30:30 +08:00
parent 3739230435
commit e717ddafd7
3 changed files with 5 additions and 12 deletions

View File

@ -262,13 +262,13 @@ on_start(
-spec on_stop(resource_id(), resource_state()) -> term().
on_stop(
ResourceID,
#{poolname := PoolName} = _State
_State
) ->
?SLOG(info, #{
msg => "stopping RabbitMQ connector",
connector => ResourceID
}),
case emqx_resource:get_allocated_resources(InstanceId) of
case emqx_resource:get_allocated_resources(ResourceID) of
#{pool_name := PoolName} ->
stop_clients_and_pool(PoolName);
_ ->

View File

@ -215,7 +215,7 @@ on_start(
sql_templates => parse_sql_template(Config),
resource_opts => ResourceOpts
},
ok = emqx_resource:allocate_resource(InstanceId, pool_name, PoolName),
ok = emqx_resource:allocate_resource(ResourceId, pool_name, PoolName),
case emqx_resource_pool:start(PoolName, ?MODULE, Options) of
ok ->
{ok, State};
@ -232,7 +232,7 @@ on_stop(ResourceId, _State) ->
msg => "stopping_sqlserver_connector",
connector => ResourceId
}),
case emqx_resource:get_allocated_resources(InstanceId) of
case emqx_resource:get_allocated_resources(ResourceId) of
#{pool_name := PoolName} ->
emqx_resource_pool:stop(PoolName);
_ ->

View File

@ -1,8 +1 @@
Refactored some bridges to avoid leaking resources during crashes at creation, including:
- TDEngine
- WebHook
- LDAP
- MongoDB
- MySQL
- PostgreSQL
- Redis
Refactored most of the bridges to avoid resource leaks during crashes during creation.