From 9b791097081b2c42a3a32ad89686ea2a13781744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 23 Sep 2024 12:33:26 +0200 Subject: [PATCH] Add DB_MAXCONN_GEVENT env var This was added in Odoo 17 --- README.rst | 1 + templates/17.0/answers.sh | 1 + templates/17.0/odoo.cfg.tmpl | 1 + templates/18.0/answers.sh | 1 + templates/18.0/odoo.cfg.tmpl | 1 + tests/data/expected-default-odoo-cfg-17.0.cfg | 1 + tests/data/expected-default-odoo-cfg-18.0.cfg | 1 + tests/data/expected-odoo-cfg-17.0.cfg | 1 + tests/data/expected-odoo-cfg-18.0.cfg | 1 + tests/test_run.py | 1 + 10 files changed, 10 insertions(+) diff --git a/README.rst b/README.rst index 23d5e7c..083a0f3 100644 --- a/README.rst +++ b/README.rst @@ -72,6 +72,7 @@ The following environment variables are used to generate the Odoo configuration * ``DB_HOST`` * ``DB_REPLICA_HOST`` (>=18) * ``DB_MAXCONN`` +* ``DB_MAXCONN_GEVENT`` (>=17) * ``DB_NAME`` * ``DB_PASSWORD`` * ``DB_PORT`` diff --git a/templates/17.0/answers.sh b/templates/17.0/answers.sh index 0e7a092..857a6c9 100644 --- a/templates/17.0/answers.sh +++ b/templates/17.0/answers.sh @@ -10,6 +10,7 @@ declare -x DB_FILTER="${DB_FILTER:-^(${DB_NAME//,/|})$}" declare -x LIST_DB="${LIST_DB:-False}" declare -x ADMIN_PASSWD="${ADMIN_PASSWD:-}" declare -x DB_MAXCONN="${DB_MAXCONN:-64}" +declare -x DB_MAXCONN_GEVENT="${DB_MAXCONN_GEVENT:-False}" declare -x LIMIT_MEMORY_SOFT="${LIMIT_MEMORY_SOFT:-2147483648}" declare -x LIMIT_MEMORY_HARD="${LIMIT_MEMORY_HARD:-2684354560}" declare -x LIMIT_REQUEST="${LIMIT_REQUEST:-8192}" diff --git a/templates/17.0/odoo.cfg.tmpl b/templates/17.0/odoo.cfg.tmpl index 41d5a24..532c485 100644 --- a/templates/17.0/odoo.cfg.tmpl +++ b/templates/17.0/odoo.cfg.tmpl @@ -13,6 +13,7 @@ dbfilter = ${DB_FILTER} list_db = ${LIST_DB} admin_passwd = ${ADMIN_PASSWD} db_maxconn = ${DB_MAXCONN} +db_maxconn_gevent = ${DB_MAXCONN_GEVENT} limit_memory_soft = ${LIMIT_MEMORY_SOFT} limit_memory_hard = ${LIMIT_MEMORY_HARD} limit_request = ${LIMIT_REQUEST} diff --git a/templates/18.0/answers.sh b/templates/18.0/answers.sh index d08c854..3f81e2f 100644 --- a/templates/18.0/answers.sh +++ b/templates/18.0/answers.sh @@ -12,6 +12,7 @@ declare -x DB_FILTER="${DB_FILTER:-^(${DB_NAME//,/|})$}" declare -x LIST_DB="${LIST_DB:-False}" declare -x ADMIN_PASSWD="${ADMIN_PASSWD:-}" declare -x DB_MAXCONN="${DB_MAXCONN:-64}" +declare -x DB_MAXCONN_GEVENT="${DB_MAXCONN_GEVENT:-False}" declare -x LIMIT_MEMORY_SOFT="${LIMIT_MEMORY_SOFT:-2147483648}" declare -x LIMIT_MEMORY_SOFT_GEVENT="${LIMIT_MEMORY_SOFT_GEVENT:-False}" declare -x LIMIT_MEMORY_HARD="${LIMIT_MEMORY_HARD:-2684354560}" diff --git a/templates/18.0/odoo.cfg.tmpl b/templates/18.0/odoo.cfg.tmpl index 76bb7c4..782f76c 100644 --- a/templates/18.0/odoo.cfg.tmpl +++ b/templates/18.0/odoo.cfg.tmpl @@ -15,6 +15,7 @@ dbfilter = ${DB_FILTER} list_db = ${LIST_DB} admin_passwd = ${ADMIN_PASSWD} db_maxconn = ${DB_MAXCONN} +db_maxconn_gevent = ${DB_MAXCONN_GEVENT} limit_memory_soft = ${LIMIT_MEMORY_SOFT} limit_memory_soft_gevent = ${LIMIT_MEMORY_SOFT_GEVENT} limit_memory_hard = ${LIMIT_MEMORY_HARD} diff --git a/tests/data/expected-default-odoo-cfg-17.0.cfg b/tests/data/expected-default-odoo-cfg-17.0.cfg index af4c9fa..6aab278 100644 --- a/tests/data/expected-default-odoo-cfg-17.0.cfg +++ b/tests/data/expected-default-odoo-cfg-17.0.cfg @@ -13,6 +13,7 @@ dbfilter = ^(odoodb)$ list_db = False admin_passwd = db_maxconn = 64 +db_maxconn_gevent = False limit_memory_soft = 2147483648 limit_memory_hard = 2684354560 limit_request = 8192 diff --git a/tests/data/expected-default-odoo-cfg-18.0.cfg b/tests/data/expected-default-odoo-cfg-18.0.cfg index b28ab38..8a52d26 100644 --- a/tests/data/expected-default-odoo-cfg-18.0.cfg +++ b/tests/data/expected-default-odoo-cfg-18.0.cfg @@ -15,6 +15,7 @@ dbfilter = ^(odoodb)$ list_db = False admin_passwd = db_maxconn = 64 +db_maxconn_gevent = False limit_memory_soft = 2147483648 limit_memory_soft_gevent = False limit_memory_hard = 2684354560 diff --git a/tests/data/expected-odoo-cfg-17.0.cfg b/tests/data/expected-odoo-cfg-17.0.cfg index b2665c8..49a9584 100644 --- a/tests/data/expected-odoo-cfg-17.0.cfg +++ b/tests/data/expected-odoo-cfg-17.0.cfg @@ -13,6 +13,7 @@ dbfilter = *DB_FILTER* list_db = *LIST_DB* admin_passwd = *ADMIN_PASSWD* db_maxconn = *DB_MAXCONN* +db_maxconn_gevent = *DB_MAXCONN_GEVENT* limit_memory_soft = *LIMIT_MEMORY_SOFT* limit_memory_hard = *LIMIT_MEMORY_HARD* limit_request = *LIMIT_REQUEST* diff --git a/tests/data/expected-odoo-cfg-18.0.cfg b/tests/data/expected-odoo-cfg-18.0.cfg index 8ed75a1..07fb122 100644 --- a/tests/data/expected-odoo-cfg-18.0.cfg +++ b/tests/data/expected-odoo-cfg-18.0.cfg @@ -15,6 +15,7 @@ dbfilter = *DB_FILTER* list_db = *LIST_DB* admin_passwd = *ADMIN_PASSWD* db_maxconn = *DB_MAXCONN* +db_maxconn_gevent = *DB_MAXCONN_GEVENT* limit_memory_soft = *LIMIT_MEMORY_SOFT* limit_memory_soft_gevent = *LIMIT_MEMORY_SOFT_GEVENT* limit_memory_hard = *LIMIT_MEMORY_HARD* diff --git a/tests/test_run.py b/tests/test_run.py index c970f24..a1d5d75 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -129,6 +129,7 @@ def test_odoo_cfg_env_vars(): "DB_HOST", "DB_REPLICA_HOST", "DB_MAXCONN", + "DB_MAXCONN_GEVENT", "DB_NAME", "DB_PASSWORD", "DB_PORT",