From c30c1396638c05dc7d61c9c140c7aee3c1c0b5b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Pavlov Date: Wed, 29 Oct 2025 13:55:58 +0200 Subject: [PATCH] Update weed/filer/filer_deletion.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- weed/filer/filer_deletion.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/filer/filer_deletion.go b/weed/filer/filer_deletion.go index 7d03efce5..47565871e 100644 --- a/weed/filer/filer_deletion.go +++ b/weed/filer/filer_deletion.go @@ -100,10 +100,10 @@ func (q *DeletionRetryQueue) AddOrUpdate(fileId string, errorMsg string) { item.RetryCount++ item.LastError = errorMsg // Calculate next retry time with exponential backoff - delay := InitialRetryDelay * time.Duration(1< MaxRetryDelay { - delay = MaxRetryDelay - } +delay := InitialRetryDelay << uint(item.RetryCount-1) +if delay > MaxRetryDelay || delay <= 0 { // Also check for overflow, which results in a non-positive duration + delay = MaxRetryDelay +} item.NextRetryAt = time.Now().Add(delay) // Re-heapify since NextRetryAt changed heap.Fix(&q.heap, item.heapIndex)