Merge pull request #48 from mistercrunch/timeout

Allowing to specify the gunicorn timeout in CLI and config
This commit is contained in:
Maxime Beauchemin 2015-10-13 16:09:24 -07:00
commit 4837968ea4
2 changed files with 6 additions and 1 deletions

View File

@ -26,7 +26,10 @@ manager.add_command('db', MigrateCommand)
@manager.option(
'-p', '--port', default=config.get("PANORAMIX_WEBSERVER_PORT"),
help="Specify the port on which to run the web server")
def runserver(debug, port):
@manager.option(
'-t', '--timeout', default=config.get("PANORAMIX_WEBSERVER_TIMEOUT"),
help="Specify the timeout (seconds) for the gunicorn web server")
def runserver(debug, port, timeout):
"""Starts a Panoramix web server"""
debug = debug or config.get("DEBUG")
if debug:
@ -38,6 +41,7 @@ def runserver(debug, port):
cmd = (
"gunicorn "
"-w 8 "
"--timeout {timeout} "
"-b 0.0.0.0:{port} "
"panoramix:app").format(**locals())
print("Starting server with command: " + cmd)

View File

@ -19,6 +19,7 @@ ROW_LIMIT = 50000
WEBSERVER_THREADS = 8
PANORAMIX_WEBSERVER_PORT = 8088
PANORAMIX_WEBSERVER_TIMEOUT = 60
CUSTOM_SECURITY_MANAGER = None
# ---------------------------------------------------------