Browse Source
Update weed/filer/filer_deletion.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
pull/7402/head
Dmitriy Pavlov
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
4 deletions
-
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<<uint(item.RetryCount-1)) |
|
|
|
if delay > 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) |
|
|
|
|