Skip to content

Commit

Permalink
fixup! refactor disk.Cache to allow concurrent inserts
Browse files Browse the repository at this point in the history
add back correct Reserve check (we can't evict enough items if
c.reservedSize+size > c.maxSize)
  • Loading branch information
mostynb committed Jul 29, 2020
1 parent 4c4770a commit 7c1e9bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache/disk/lru.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (c *sizedLRU) MaxSize() int64 {
}

func (c *sizedLRU) Reserve(size int64) bool {
if size < 0 || size > c.maxSize || c.currentSize+size > c.maxSize {
if size < 0 || size > c.maxSize || c.reservedSize+size > c.maxSize {
return false
}

Expand Down

0 comments on commit 7c1e9bd

Please sign in to comment.