Skip to content

Commit

Permalink
Merge pull request #96 from coopdevs/feature/workers-and-channels
Browse files Browse the repository at this point in the history
Add support for workers and channels
  • Loading branch information
enricostano authored Jan 10, 2021
2 parents bfb2d09 + b6b7fd9 commit f448fd1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ odoo_role_list_db: false
odoo_role_odoo_http_interface: 0.0.0.0
# Set this to true when Odoo runs behind a reverse proxy
odoo_role_odoo_proxy_mode: false
# Specify how many HTTP workers you need (default is 1)
odoo_role_workers: 2
```
* Core modules list to install/update
Expand Down Expand Up @@ -131,13 +133,18 @@ This option add to the Odoo configuration file the section and option to develop

* [Queue Job](https://github.com/OCA/queue/blob/12.0/queue_job) support

If you need to use the module queue\_job, use. Don't forget to install the module using *Community Roles*:
If you need to use the module [queue\_job](https://github.com/OCA/queue/blob/12.0/queue_job), use:
```yaml
odoo_role_enable_queue_job: true
```

This option add to the Odoo configuration file the option to enable queue\_job as a new thread/process: https://github.com/OCA/queue/blob/12.0/queue\_job/README.rst#id12

You can also define how many workers you want to use to execute the jobs:
```yaml
odoo_role_channels: root:2
```

* Environment variables

If you need to define a set of environment variables for your server, you can use the `environment_variables` dict var:
Expand Down
10 changes: 10 additions & 0 deletions templates/odoo.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ unaccent = True
; Hack to avoid LC_COLLATE="C"
db_template = template1

{% if odoo_role_workers and odoo_role_workers > 1 %}
; If workers > 1 are defined, add a /location in Nginx server for LongPolling
workers = {{ odoo_role_workers }}
{% endif %}

{% if odoo_role_enable_queue_job and odoo_role_channels %}
[queue_job]
channels = {{ odoo_role_channels }}
{% endif %}

{% if odoo_role_dev_mode and odoo_role_enabled_rest_framework %}
[base_rest]
dev_mode=True
Expand Down

0 comments on commit f448fd1

Please sign in to comment.