Skip to content

Commit

Permalink
Bump up the timeout for another B&T endpoint (#1932)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen authored Jul 16, 2024
1 parent cebbe20 commit caabd3f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/palace/manager/api/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,13 @@ def get_fulfillment_info(self, transaction_id: str) -> RequestsResponse:
"""Make a call to the getFulfillmentInfoAPI."""
url = self.base_url + self.fulfillment_endpoint
params = dict(TransactionID=transaction_id)
return self.request(url, "POST", params=params)
# We set an explicit timeout because this request can take a long time and
# the default was too short. Ideally B&T would fix this on their end, but
# in the meantime we need to work around it.
# TODO: Revisit this timeout. Hopefully B&T will fix the performance
# of this endpoint and we can remove this. We should be able to query
# our logs to see how long these requests are taking.
return self.request(url, "POST", params=params, timeout=15)

def get_audiobook_metadata(self, findaway_content_id: str) -> RequestsResponse:
"""Make a call to the getaudiobookmetadata endpoint."""
Expand All @@ -384,6 +390,9 @@ def get_audiobook_metadata(self, findaway_content_id: str) -> RequestsResponse:
# We set an explicit timeout because this request can take a long time and
# the default was too short. Ideally B&T would fix this on their end, but
# in the meantime we need to work around it.
# TODO: Revisit this timeout. Hopefully B&T will fix the performance
# of this endpoint and we can remove this. We should be able to query
# our logs to see how long these requests are taking.
response = self.request(url, "POST", params=params, timeout=15)
return response

Expand Down

0 comments on commit caabd3f

Please sign in to comment.