Skip to content

Commit

Permalink
Merge pull request #2914 from Yelp/configure-api-timeout
Browse files Browse the repository at this point in the history
Add option for gunicorn worker timeouts to the api
  • Loading branch information
qui committed Sep 14, 2020
2 parents b2699e7 + df901b6 commit abaec47
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions paasta_tools/api/api.py
Expand Up @@ -66,6 +66,12 @@ def parse_paasta_api_args():
dest="cluster",
help="specify a cluster. If no empty, the cluster from /etc/paasta is used",
)
parser.add_argument(
"--max-request-seconds",
default=120,
dest="max_request_seconds",
help="Maximum seconds allowed for a worker to process a request",
)
args = parser.parse_args()
return args

Expand Down Expand Up @@ -241,6 +247,10 @@ def main(argv=None):
"4",
"--bind",
f":{args.port}",
"--timeout",
str(args.max_request_seconds),
"--graceful-timeout",
str(args.max_request_seconds),
"paasta_tools.api.api:application",
)

Expand Down

0 comments on commit abaec47

Please sign in to comment.