Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Support retrying Datastore operations. #168

Merged
merged 3 commits into from
Jul 21, 2023
Merged

Conversation

isoos
Copy link
Contributor

@isoos isoos commented Jul 20, 2023

No description provided.

/// operation.
factory Datastore.withRetry(
Datastore delegate, {
RetryOptions? retryOptions,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not make types from package:retry public. I think maxAttempts and maybe retryIf is the maximum arguments we need to expose.

Also if we ever need we can remove the dependency on package:retry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Leaving retryIf for a later extension of the API, we may not need it after all...

}
}

bool _retryIf(Exception e) => e is! datastore.TransactionAbortedError;
Copy link
Contributor

Choose a reason for hiding this comment

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

side note: The only one I see any code throw is NeedIndexError... So there is something else we could improve 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jonasfj jonasfj merged commit 12e82a1 into dart-archive:master Jul 21, 2023
devoncarew pushed a commit to dart-lang/labs that referenced this pull request Sep 27, 2024
* Support retrying Datastore operations.

* Expose only maxAttempts

* add more errors
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants