-
Notifications
You must be signed in to change notification settings - Fork 42
Support retrying Datastore operations. #168
Conversation
lib/datastore.dart
Outdated
/// operation. | ||
factory Datastore.withRetry( | ||
Datastore delegate, { | ||
RetryOptions? retryOptions, |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
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...
lib/src/retry_datastore_impl.dart
Outdated
} | ||
} | ||
|
||
bool _retryIf(Exception e) => e is! datastore.TransactionAbortedError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- NeedIndexError
- PermissionDeniedError
- QuotaExceededError
might not be worth retrying?
side note: The only one I see any code throw is NeedIndexError
... So there is something else we could improve 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* Support retrying Datastore operations. * Expose only maxAttempts * add more errors
No description provided.