Skip to content

Commit

Permalink
Allowing to specify the gunicorn timeout in CLI and config
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 13, 2015
1 parent 7793e24 commit 686069d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion panoramix/bin/panoramix
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions panoramix/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
WEBSERVER_THREADS = 8

PANORAMIX_WEBSERVER_PORT = 8088
PANORAMIX_WEBSERVER_TIMEOUT = 30

CUSTOM_SECURITY_MANAGER = None
# ---------------------------------------------------------
Expand Down

0 comments on commit 686069d

Please sign in to comment.