Commit 50a9577b authored by François Ferry's avatar François Ferry
Browse files

feat(pyramid-ctl): add "nb-threads" parameter to cubicweb-ctl pyramid.

This parameter will be passed to waitress.
https://docs.pylonsproject.org/projects/waitress/en/stable/arguments.html

related: #119
parent 0bf284839d6f
......@@ -124,6 +124,10 @@ class PyramidStartHandler(InstanceCommand):
'metavar': 'N',
'help': 'Dump profile stats to ouput every N requests '
'(default: 100)'}),
('nb-threads',
{'type': 'int',
'default': 4,
'help': 'The number of threads used by the server.'}),
('param',
{'short': 'p',
'type': 'named',
......@@ -291,7 +295,7 @@ class PyramidStartHandler(InstanceCommand):
repo = app.application.registry['cubicweb.repository']
try:
waitress.serve(app, host=host, port=port, url_scheme=url_scheme,
clear_untrusted_proxy_headers=True)
clear_untrusted_proxy_headers=True, threads=self['nb-threads'])
finally:
repo.shutdown()
if self._needreload:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment