in proxy_worker/dispatcher.py [0:0]
def _get_sync_tp_max_workers() -> typing.Optional[int]:
def tp_max_workers_validator(value: str) -> bool:
try:
int_value = int(value)
except ValueError:
logger.warning('%s must be an integer',
PYTHON_THREADPOOL_THREAD_COUNT)
return False
if int_value < 1:
logger.warning(
'%s must be set to a value between 1 and sys.maxint. '
'Reverting to default value for max_workers',
PYTHON_THREADPOOL_THREAD_COUNT,
1)
return False
return True
max_workers = get_app_setting(setting=PYTHON_THREADPOOL_THREAD_COUNT,
validator=tp_max_workers_validator)
# We can box the app setting as int for earlier python versions.
return int(max_workers) if max_workers else None