From c5f1bda86eb3f522968650df3c52776c4efda3a8 Mon Sep 17 00:00:00 2001 From: Darja Malyavkina Date: Mon, 10 Oct 2016 17:47:08 +0300 Subject: [PATCH] Set value by default will be equal to the number of CPUs available. Change-Id: Ic9865e0b4019a114a537b9aa28da6dd41bf88c73 --- glare/common/wsgi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glare/common/wsgi.py b/glare/common/wsgi.py index 73100f4..9c1eaa3 100644 --- a/glare/common/wsgi.py +++ b/glare/common/wsgi.py @@ -80,11 +80,11 @@ socket_opts = [ ] eventlet_opts = [ - cfg.IntOpt('workers', default=0, + cfg.IntOpt('workers', default=0, min=0, help=_('The number of child process workers that will be ' 'created to service requests. The default will be ' 'equal to the number of CPUs available.')), - cfg.IntOpt('max_header_line', default=16384, + cfg.IntOpt('max_header_line', default=16384, min=0, help=_('Maximum line size of message headers to be accepted. ' 'max_header_line may need to be increased when using ' 'large tokens (typically those generated by the ' @@ -98,7 +98,7 @@ eventlet_opts = [ 'read successfully by the client, you simply have to ' 'set this option to False when you create a wsgi ' 'server.')), - cfg.IntOpt('client_socket_timeout', default=900, + cfg.IntOpt('client_socket_timeout', default=900, min=0, help=_('Timeout for client connections\' socket operations. ' 'If an incoming connection is idle for this number of ' 'seconds it will be closed. A value of \'0\' means ' @@ -119,7 +119,7 @@ ASYNC_EVENTLET_THREAD_POOL_LIST = [] def get_num_workers(): """Return the configured number of workers.""" - if CONF.workers is None: + if not CONF.workers: # None implies the number of CPUs return processutils.get_worker_count() return CONF.workers