chore: update changes
This commit is contained in:
parent
3739230435
commit
e717ddafd7
|
@ -262,13 +262,13 @@ on_start(
|
||||||
-spec on_stop(resource_id(), resource_state()) -> term().
|
-spec on_stop(resource_id(), resource_state()) -> term().
|
||||||
on_stop(
|
on_stop(
|
||||||
ResourceID,
|
ResourceID,
|
||||||
#{poolname := PoolName} = _State
|
_State
|
||||||
) ->
|
) ->
|
||||||
?SLOG(info, #{
|
?SLOG(info, #{
|
||||||
msg => "stopping RabbitMQ connector",
|
msg => "stopping RabbitMQ connector",
|
||||||
connector => ResourceID
|
connector => ResourceID
|
||||||
}),
|
}),
|
||||||
case emqx_resource:get_allocated_resources(InstanceId) of
|
case emqx_resource:get_allocated_resources(ResourceID) of
|
||||||
#{pool_name := PoolName} ->
|
#{pool_name := PoolName} ->
|
||||||
stop_clients_and_pool(PoolName);
|
stop_clients_and_pool(PoolName);
|
||||||
_ ->
|
_ ->
|
||||||
|
|
|
@ -215,7 +215,7 @@ on_start(
|
||||||
sql_templates => parse_sql_template(Config),
|
sql_templates => parse_sql_template(Config),
|
||||||
resource_opts => ResourceOpts
|
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
|
case emqx_resource_pool:start(PoolName, ?MODULE, Options) of
|
||||||
ok ->
|
ok ->
|
||||||
{ok, State};
|
{ok, State};
|
||||||
|
@ -232,7 +232,7 @@ on_stop(ResourceId, _State) ->
|
||||||
msg => "stopping_sqlserver_connector",
|
msg => "stopping_sqlserver_connector",
|
||||||
connector => ResourceId
|
connector => ResourceId
|
||||||
}),
|
}),
|
||||||
case emqx_resource:get_allocated_resources(InstanceId) of
|
case emqx_resource:get_allocated_resources(ResourceId) of
|
||||||
#{pool_name := PoolName} ->
|
#{pool_name := PoolName} ->
|
||||||
emqx_resource_pool:stop(PoolName);
|
emqx_resource_pool:stop(PoolName);
|
||||||
_ ->
|
_ ->
|
||||||
|
|
|
@ -1,8 +1 @@
|
||||||
Refactored some bridges to avoid leaking resources during crashes at creation, including:
|
Refactored most of the bridges to avoid resource leaks during crashes during creation.
|
||||||
- TDEngine
|
|
||||||
- WebHook
|
|
||||||
- LDAP
|
|
||||||
- MongoDB
|
|
||||||
- MySQL
|
|
||||||
- PostgreSQL
|
|
||||||
- Redis
|
|
||||||
|
|
Loading…
Reference in New Issue