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 retry logic for status code - 503 #226

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

sgandhi1311
Copy link
Member

Description of change

This pull request introduces a robust retry logic system for handling HTTP status code 503 (Service Unavailable) errors. When encountering this status code, the system will now automatically initiate a retry mechanism to ensure a more reliable and resilient operation.

Manual QA steps

  • Unit test case for status code - 503

Risks

  • low

Rollback steps

  • revert this branch

Comment on lines 58 to 64
mocked_account.get_ad_creatives.side_effect = FacebookRequestError(
message='',
request_context={"":Mock()},
http_status=503,
http_headers=Mock(),
body={}
)

Choose a reason for hiding this comment

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

To mock actual exception, can we assign string value to the body?

Suggested change
mocked_account.get_ad_creatives.side_effect = FacebookRequestError(
message='',
request_context={"":Mock()},
http_status=503,
http_headers=Mock(),
body={}
)
mocked_account.get_ad_creatives.side_effect = FacebookRequestError(
message='',
request_context={"":Mock()},
http_status=503,
http_headers=Mock(),
body="Service Unavailable"
)

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@sgandhi1311 sgandhi1311 merged commit 510eeb0 into master Sep 13, 2023
7 checks passed
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