Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed get_wait_time_based_on_response #3

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading