Datastore.withRetry constructor

Datastore.withRetry(
  1. Datastore delegate, {
  2. int? maxAttempts,
})

Retry Datastore operations where the issue seems to be transient.

The delegate is the configured Datastore implementation that will be used.

The operations will be retried at maximum of maxAttempts.

Implementation

factory Datastore.withRetry(
  Datastore delegate, {
  int? maxAttempts,
}) {
  return RetryDatastoreImpl(
    delegate,
    RetryOptions(maxAttempts: maxAttempts ?? 3),
  );
}