Skip to content

Commit

Permalink
respond to timeouts better
Browse files Browse the repository at this point in the history
Signed-off-by: Praneeth Bedapudi <[email protected]>
  • Loading branch information
bedapudi6788 committed Oct 30, 2024
1 parent f528c88 commit 015ceee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion fastdeploy/_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,14 @@ def on_post(self, req, resp):
) = self._response_handler.register_request_and_wait_for_response(
unique_id, is_compressed, input_type, client_timeout
)
resp.status = falcon.HTTP_200 if success else falcon.HTTP_400
if success:
resp.status = falcon.HTTP_200
else:
if response["reason"] == "timeout":
resp.status = falcon.HTTP_408
else:
resp.status = falcon.HTTP_500

if input_type == "json":
resp.media = response
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
EMAIL = "[email protected]"
AUTHOR = "BEDAPUDI PRANEETH"
REQUIRES_PYTHON = ">=3.6.0"
VERSION = "3.0.24"
VERSION = "3.0.25"

# What packages are required for this module to be executed?
REQUIRED = ["falcon", "liteindex==0.0.3.2.dev4", "zstandard", "gunicorn[gevent]", "msgpack"]
Expand Down

0 comments on commit 015ceee

Please sign in to comment.