Skip to content

Commit 21045c7

Browse files
fix(mod_mpm): cast to int to avoid Jinja type mismatch error
This fixes the following error when Jinja tries to process `mpm_prefork.conf.jinja` or `00-mpm.conf.jinja`, when it processes the `max_request_workers` comparison: ``` Unable to manage file: Jinja error: '>=' not supported between instances of 'str' and 'int' [...] <IfModule mpm_prefork_module> StartServers {{ mpm_param['start_servers'] | d('5') }} MaxRequestWorkers {{ mpm_param['max_request_workers'] | d('150') }} {%- if mpm_param['max_request_workers'] | d('150') >= 256 %} <====================== ServerLimit {{ mpm_param['max_request_workers'] | d('150') }} {%- endif %} MinSpareServers {{ mpm_param['min_spare_servers'] | d('5') }} MaxSpareServers {{ mpm_param['max_spare_servers'] | d('10') }} MaxConnectionsPerChild {{ mpm_param['max_connections_per_child'] | d('0') }} ``` Add filters that convert the values to an int first.
1 parent 13be6f9 commit 21045c7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apache/files/Debian/mpm/mpm_prefork.conf.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<IfModule mpm_prefork_module>
1515
StartServers {{ mpm_param['start_servers'] | d('5') }}
1616
MaxRequestWorkers {{ mpm_param['max_request_workers'] | d('150') }}
17-
{%- if mpm_param['max_request_workers'] | d('150') >= 256 %}
17+
{%- if mpm_param['max_request_workers'] | d('150') | int >= 256 %}
1818
ServerLimit {{ mpm_param['max_request_workers'] | d('150') }}
1919
{%- endif %}
2020
MinSpareServers {{ mpm_param['min_spare_servers'] | d('5') }}

apache/files/RedHat/conf.modules.d/00-mpm.conf.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LoadModule {{ mpm_module }}_module modules/mod_{{ mpm_module }}.so
2121
<IfModule mpm_prefork_module>
2222
StartServers {{ mpm_param['start_servers'] | d('5') }}
2323
MaxRequestWorkers {{ mpm_param['max_request_workers'] | d('150') }}
24-
{%- if mpm_param['max_request_workers'] | d('150') >= 256 %}
24+
{%- if mpm_param['max_request_workers'] | d('150') | int >= 256 %}
2525
ServerLimit {{ mpm_param['max_request_workers'] | d('150') }}
2626
{%- endif %}
2727
MinSpareServers {{ mpm_param['min_spare_servers'] | d('5') }}

0 commit comments

Comments
 (0)