Skip to content

Commit

Permalink
fix: reserve size decrement correction
Browse files Browse the repository at this point in the history
  • Loading branch information
alok committed Jul 30, 2023
1 parent e15a7c6 commit 6b7acfb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/storer/internal/reserve/reserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ func (r *Reserve) EvictBatchBin(
}

batchCnt := 1000
evictionCompleted := 0

for i := 0; i < len(evicted); i += batchCnt {
end := i + batchCnt
Expand Down Expand Up @@ -346,11 +347,12 @@ func (r *Reserve) EvictBatchBin(
return batch.Commit()
})
if err != nil {
return 0, err
return evictionCompleted, err
}
evictionCompleted += end - i
}

return len(evicted), nil
return evictionCompleted, nil
}

func (r *Reserve) DeleteChunk(
Expand Down

0 comments on commit 6b7acfb

Please sign in to comment.