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
parent
commit
c30c139663
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      weed/filer/filer_deletion.go

8
weed/filer/filer_deletion.go

@ -100,10 +100,10 @@ func (q *DeletionRetryQueue) AddOrUpdate(fileId string, errorMsg string) {
item.RetryCount++ item.RetryCount++
item.LastError = errorMsg item.LastError = errorMsg
// Calculate next retry time with exponential backoff // 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) item.NextRetryAt = time.Now().Add(delay)
// Re-heapify since NextRetryAt changed // Re-heapify since NextRetryAt changed
heap.Fix(&q.heap, item.heapIndex) heap.Fix(&q.heap, item.heapIndex)

Loading…
Cancel
Save