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

Add backoff on calls to login fn #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KAllan357
Copy link
Contributor

Description of change

In a busy Pardot API scenario, its possible for the call to login to be rate limited. This is an attempt to retry those errors.

Manual QA steps

Risks

Rollback steps

  • revert this branch

Copy link
Collaborator

@dmosorast dmosorast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I think the retry pattern is good, just one change.

response.raise_for_status()
# 5xx errors should be retried
if response.status_code >= 500:
raise Pardot5xxError()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want to maybe raise_for_status after the _check_error call below, to catch any statuses that we don't know about yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants