diff --git a/README.md b/README.md index 0d0841ef8d6dd8bf08658acb5941710ad5cab604..5ae8c799155310ea3db9431b108425d609fe6da2 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ odoo_prod_example: # To be renamed odoo_prod db_pass: "odooDbPasswordToBeModified" # PROD Database name db: "odoo" + ## OPTIONAL - use this variable to force using multiprocessing iso multithreading + # force_odoo_workers: True ## OPTIONAL - only needed if no nonprod_instances are defined ## Custom modules Le Filament (one module per repo) # custom_modules: @@ -124,6 +126,8 @@ odoo_nonprod_instances_example: # To be renamed odoo_nonprod_instances db: "odoo_test" ## Tag that will be used on the built test Docker image image_version: "{{ odoo_version }}_test" + ## OPTIONAL - use this variable to force using multiprocessing iso multithreading + # force_odoo_workers: True ## Custom modules Le Filament (one module per repo) custom_modules: - automatic_bank_statement_import diff --git a/templates/odoo.conf.j2 b/templates/odoo.conf.j2 index 33cdfa7aa9462ac72ffb3bc606ab4d1d27c04c58..1358a2706952528046bfeca35b1abe5468958c15 100644 --- a/templates/odoo.conf.j2 +++ b/templates/odoo.conf.j2 @@ -49,7 +49,7 @@ smtp_server = smtp ; smtp_user = False unaccent = True without_demo = all -{% if ansible_processor_vcpus > 2 %} +{% if ansible_processor_vcpus > 2 or odoo_prod.force_odoo_workers is defined %} workers = {{ (ansible_processor_vcpus * 2 - 1) | int | abs }} max_cron_threads = {{ ansible_processor_vcpus | int }} {% else %} diff --git a/templates/prod.yaml.j2 b/templates/prod.yaml.j2 index e205cc03541585e8bb93431182356cc2771b5149..54db4c60ec9d3904b152dcf3d4a5d0e402a31a5d 100644 --- a/templates/prod.yaml.j2 +++ b/templates/prod.yaml.j2 @@ -45,7 +45,7 @@ services: co.elastic.logs/multiline.negate: 'true' co.elastic.logs/multiline.match: "after" traefik.enable: "true" -{% if ansible_processor_vcpus > 2 %} +{% if ansible_processor_vcpus > 2 or odoo_prod.force_odoo_workers is defined %} traefik.http.routers.odoo-longpolling.rule: "Host(`{{ odoo_prod.url }}`{% if odoo_prod.url2 is defined %}, `{{ odoo_prod.url2 }}`{% endif %}) && PathPrefix(`/longpolling/`)" traefik.http.routers.odoo-longpolling.service: "odoo-longpolling" traefik.http.services.odoo-longpolling.loadbalancer.server.port: "8072" diff --git a/templates/test.yaml.j2 b/templates/test.yaml.j2 index 0076e9a481451b6c8cf79d3e1a16c3007378776c..8f1763925130732e439fd7c68c69e75d11b20b30 100644 --- a/templates/test.yaml.j2 +++ b/templates/test.yaml.j2 @@ -35,7 +35,7 @@ services: labels: co.elastic.logs/enabled: "false" traefik.enable: "true" -{% if ansible_processor_vcpus > 2 %} +{% if ansible_processor_vcpus > 2 or item.force_odoo_workers is defined %} traefik.http.routers.{{ item.dir }}-longpolling.rule: "Host(`{{ item.url }}`) && PathPrefix(`/longpolling/`)" traefik.http.routers.{{ item.dir }}-longpolling.service: "{{ item.dir }}-longpolling" traefik.http.services.{{ item.dir }}-longpolling.loadbalancer.server.port: "8072" @@ -52,9 +52,11 @@ services: - --smtp-port=1025 - --database={{ item.db }} - --init=web_environment_ribbon -{% if ansible_processor_vcpus > 2 %} +{% if ansible_processor_vcpus > 2 or item.force_odoo_workers is defined %} - --workers=2 - --max-cron-threads=1 +{% elif odoo_prod.force_odoo_workers is defined %} + - --workers=0 {% endif %} db: