Skip to content

Commit

Permalink
increase default connect and write timeout in surf backend
Browse files Browse the repository at this point in the history
  • Loading branch information
hanstrompert committed Jul 17, 2024
1 parent 57457f1 commit 7035dbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/supa/nrm/backends/surf.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ terminate_workflow_name=terminate_nsi_light_path
customer_id=0a11ebb9-0d11-e511-80d0-005056956c1a
product_id=c09d7cee-4e7d-461d-9ac3-5e54f6199407
# see https://requests.readthedocs.io/en/latest/user/advanced/#timeouts
#connect_timeout: float = 3.05
#connect_timeout: float = 9.05
#read_timeout: float = 12.0
#write_timeout: float = 6.0
#write_timeout: float = 18.0
5 changes: 2 additions & 3 deletions src/supa/nrm/backends/surf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class BackendSettings(BaseSettings):
terminate_workflow_name: str = ""
customer_id: str = ""
product_id: str = ""
connect_timeout: float = 3.05
connect_timeout: float = 9.05
read_timeout: float = 12.0
write_timeout: float = 9.0
write_timeout: float = 18.0


class Backend(BaseBackend):
Expand Down Expand Up @@ -100,7 +100,6 @@ def _post_url_json(self, url: str, json: Any) -> Response:
timeout = (self.backend_settings.connect_timeout, self.backend_settings.write_timeout)
start = time.time()
response = post(url=url, headers=headers, json=json, timeout=timeout)
self.log.debug(f"post({url}) took {time.time() - start} seconds")
self.log.debug("post url timer", url=url, seconds=time.time() - start)
return response

Expand Down

0 comments on commit 7035dbd

Please sign in to comment.