Merge pull request #7187 from savonarola/mongo-no-double-pooling

chore(mongodb): do not use mongodb internal pool
This commit is contained in:
Ilya Averyanov 2022-03-03 11:47:41 +03:00 committed by GitHub
commit 4b19fb575a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,7 @@ fields(sharded) ->
, {w_mode, fun w_mode/1}
] ++ mongo_fields();
fields(topology) ->
[ {pool_size, fun emqx_connector_schema_lib:pool_size/1}
[ {pool_size, fun internal_pool_size/1}
, {max_overflow, fun emqx_connector_schema_lib:pool_size/1}
, {overflow_ttl, fun duration/1}
, {overflow_check_period, fun duration/1}
@ -97,6 +97,11 @@ mongo_fields() ->
] ++
emqx_connector_schema_lib:ssl_fields().
internal_pool_size(type) -> integer();
internal_pool_size(default) -> 1;
internal_pool_size(validator) -> [?MIN(1)];
internal_pool_size(_) -> undefined.
%% ===================================================================
on_start(InstId, Config = #{mongo_type := Type,