From ee95a1f412821886473b0b08b55d83120cfe7a33 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Mon, 13 Dec 2021 12:08:03 -0500 Subject: [PATCH] update idempotency condition --- storage/writer.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/storage/writer.go b/storage/writer.go index dd468c5bf9e2..51d8b63779b8 100644 --- a/storage/writer.go +++ b/storage/writer.go @@ -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