From 7da39d87c59dfe34836b9e907a5a9bac7fad6bbe Mon Sep 17 00:00:00 2001 From: Mikhail Uvarov Date: Wed, 4 Aug 2021 17:09:22 +0200 Subject: [PATCH] Rename pool_name opt to db_pool --- doc/developers-guide/domain_management.md | 12 ++++++------ src/domain/mongoose_domain_sql.erl | 2 +- src/domain/service_domain_db.erl | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/developers-guide/domain_management.md b/doc/developers-guide/domain_management.md index d383065b64..d2ce78b765 100644 --- a/doc/developers-guide/domain_management.md +++ b/doc/developers-guide/domain_management.md @@ -103,18 +103,18 @@ Configure host-type first to delete such domains. ```toml [services.service_domain_db] - pool_name = "global" + db_pool = "global" event_cleaning_interval = 1800 event_max_age = 7200 ``` -### `pool_name` +### `db_pool` +By default, this service uses the RDBMS connection pool configured with the scope `"global"`. +You can put a specific host type there to use the pool with the `"host"` or `"single_host"` scope for that particular host type. See [outgoing connections docs](../advanced-configuration/outgoing-connections.md) for more information about pool scopes. -Pool name to use for a database connection. - -* **Syntax:** atom +* **Syntax:** string * **Default:** `global` -* **Example:** `pool_name = "global"` +* **Example:** `db_pool = "my_host_type"` ### `event_cleaning_interval` The number of seconds between cleaning attempts of the `domain_events` table. diff --git a/src/domain/mongoose_domain_sql.erl b/src/domain/mongoose_domain_sql.erl index eaeff5fe33..438f54d0ef 100644 --- a/src/domain/mongoose_domain_sql.erl +++ b/src/domain/mongoose_domain_sql.erl @@ -260,7 +260,7 @@ row_to_map({HostType, Enabled}) -> #{host_type => HostType, enabled => mongoose_rdbms:to_bool(Enabled)}. get_db_pool() -> - proplists:get_value(pool_name, get_service_opts(), global). + proplists:get_value(db_pool, get_service_opts(), global). get_service_opts() -> mongoose_service:get_service_opts(service_domain_db). diff --git a/src/domain/service_domain_db.erl b/src/domain/service_domain_db.erl index f03e64bf99..b8db96601c 100644 --- a/src/domain/service_domain_db.erl +++ b/src/domain/service_domain_db.erl @@ -58,8 +58,8 @@ config_spec() -> validate = positive}, <<"event_max_age">> => #option{type = integer, validate = positive}, - <<"pool_name">> => #option{type = atom, - validate = pool_name} + <<"db_pool">> => #option{type = atom, + validate = pool_name} }}. start_link() ->