mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Change cache purge routine granularity to hours (#8660)
With this PR,cache eviction will continue until no LRU entries older than an hour can be cache evicted or sufficient percentage of disk space has been reclaimed.
This commit is contained in:
parent
e6ce9da087
commit
04de3ea4bd
@ -220,10 +220,10 @@ func (c *diskCache) purge() {
|
||||
}
|
||||
ctx := context.Background()
|
||||
for {
|
||||
olderThan := c.expiry
|
||||
olderThan := c.expiry * 24
|
||||
for !c.diskUsageLow() {
|
||||
// delete unaccessed objects older than expiry duration
|
||||
expiry := UTCNow().AddDate(0, 0, -1*olderThan)
|
||||
expiry := UTCNow().Add(time.Hour * time.Duration(-1*olderThan))
|
||||
olderThan /= 2
|
||||
if olderThan < 1 {
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user