Skip to content

Commit

Permalink
update idempotency condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tritone committed Dec 14, 2021
1 parent 1d1fe4d commit 0515116
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions storage/writer.go
Expand Up @@ -174,10 +174,7 @@ func (w *Writer) open() error {
// there is no need to add retries here.

// Retry only when the operation is idempotent or the retry policy is RetryAlways.
var isIdempotent bool
if w.o.conds != nil && (w.o.conds.GenerationMatch >= 0 || w.o.conds.DoesNotExist == true) {
isIdempotent = true
}
isIdempotent := w.o.conds != nil && (w.o.conds.GenerationMatch >= 0 || w.o.conds.DoesNotExist == true)
var useRetry bool
if (w.o.retry == nil || w.o.retry.policy == RetryIdempotent) && isIdempotent {
useRetry = true
Expand Down

0 comments on commit 0515116

Please sign in to comment.