Skip to content

Commit

Permalink
fixed get_wait_time_based_on_response
Browse files Browse the repository at this point in the history
  • Loading branch information
jlloyd-widen committed Sep 12, 2024
1 parent e1c4cbc commit 0bd6829
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tap-salesforce-connect"
version = "0.1.2"
version = "0.1.3"
description = "`tap-salesforce-connect` is a Singer tap for SalesforceConnect, built with the Meltano Singer SDK."
readme = "README.md"
authors = ["Josh Lloyd"]
Expand Down
10 changes: 7 additions & 3 deletions tap_salesforce_connect/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ def get_wait_time_based_on_response(self, exception):
Salesforce Connect API has a rate limit scoped to an hour
"""
if exception.response.status_code == 503:
return 60 * 60
return exception.response.headers.get("Retry-After", 0)
if exception.response:
if exception.response.status_code == 503:
return 60 * 60
else:
return exception.response.headers.get("Retry-After", 0)
else:
return 0

def backoff_wait_generator(self) -> Generator[float, None, None]:
"""Return a generator of wait times between retries."""
Expand Down

0 comments on commit 0bd6829

Please sign in to comment.