Merge pull request #590 from 3flex/540-refine-worker_processes-validation
config: refined worker_processes validation
This commit is contained in:
commit
0cd258b310
2 changed files with 7 additions and 1 deletions
|
@ -94,7 +94,7 @@ class nginx::config(
|
|||
) inherits ::nginx::params {
|
||||
|
||||
### Validations ###
|
||||
if (!is_string($worker_processes)) and (!is_integer($worker_processes)) {
|
||||
if ($worker_processes != 'auto') and (!is_integer($worker_processes)) {
|
||||
fail('$worker_processes must be an integer or have value "auto".')
|
||||
}
|
||||
if (!is_integer($worker_connections)) {
|
||||
|
|
|
@ -76,6 +76,12 @@ describe 'nginx::config' do
|
|||
:value => '4',
|
||||
:match => 'worker_processes 4;',
|
||||
},
|
||||
{
|
||||
:title => 'should set worker_processes',
|
||||
:attr => 'worker_processes',
|
||||
:value => 'auto',
|
||||
:match => 'worker_processes auto;',
|
||||
},
|
||||
{
|
||||
:title => 'should set worker_rlimit_nofile',
|
||||
:attr => 'worker_rlimit_nofile',
|
||||
|
|
Loading…
Reference in a new issue