From caabd3f1c6b6ffc36a308bc7a8eaf68604f55b99 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Tue, 16 Jul 2024 16:04:26 -0300 Subject: [PATCH] Bump up the timeout for another B&T endpoint (#1932) --- src/palace/manager/api/axis.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/palace/manager/api/axis.py b/src/palace/manager/api/axis.py index fa35a6915..b5fd15837 100644 --- a/src/palace/manager/api/axis.py +++ b/src/palace/manager/api/axis.py @@ -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.""" @@ -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