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 retries when fetching data from DB #149

Merged
merged 13 commits into from
Jul 18, 2023
Merged

Add retries when fetching data from DB #149

merged 13 commits into from
Jul 18, 2023

Conversation

brenoafb
Copy link
Contributor

@brenoafb brenoafb commented Jul 6, 2023

Requests can occasionally fail due to transient network issues. One way to fix this is by retrying idempotent requests with exponential backoff between each retry.

This PR adds a retry_count field to the Database and AsyncDatabase classes that defines the maximum amount of times a database fetch is retried.

@brenoafb brenoafb marked this pull request as ready for review July 10, 2023 12:52
src/replit/database/database.py Outdated Show resolved Hide resolved
src/replit/database/database.py Outdated Show resolved Hide resolved
src/replit/database/database.py Outdated Show resolved Hide resolved
Copy link
Contributor

@lhchavez lhchavez left a comment

Choose a reason for hiding this comment

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

lgtm but wait for Ryan's resolution of the last remaining thread.

Copy link
Collaborator

@ryantm ryantm left a comment

Choose a reason for hiding this comment

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

Nice, that library really cleans it up.

@brenoafb brenoafb requested a review from a team as a code owner July 18, 2023 13:31
@brenoafb brenoafb requested review from airportyh and removed request for a team July 18, 2023 13:31
brenoafb and others added 13 commits July 18, 2023 13:38
author brenoafb <breno.afb@gmail.com> 1680894638 +0000
committer Replit user <> 1688675354 +0000

Load Replit DB URL from a file

Add option to auth into DB using Repl Identity

Remove print

Update version

Add retries to get requests
Co-authored-by: lhchavez <lhchavez@lhchavez.com>
@masad-frost masad-frost merged commit a2ef4f3 into master Jul 18, 2023
@masad-frost masad-frost deleted the bb-retries branch July 18, 2023 14:05
@blast-hardcheese blast-hardcheese added the enhancement New feature or request label Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants