mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix: Do not cleanup range files in cache SaveMetadata when total hits are false (#10728)
This commit is contained in:
parent
a982baff27
commit
be7f67268d
@ -538,12 +538,15 @@ func (c *diskCache) saveMetadata(ctx context.Context, bucket, object string, met
|
|||||||
}
|
}
|
||||||
m.Ranges[rs.String(actualSize)] = rsFileName
|
m.Ranges[rs.String(actualSize)] = rsFileName
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
if rs == nil && !incHitsOnly {
|
||||||
// this is necessary cleanup of range files if entire object is cached.
|
// this is necessary cleanup of range files if entire object is cached.
|
||||||
for _, f := range m.Ranges {
|
if _, err := os.Stat(pathJoin(cachedPath, cacheDataFile)); err == nil {
|
||||||
removeAll(pathJoin(cachedPath, f))
|
for _, f := range m.Ranges {
|
||||||
|
removeAll(pathJoin(cachedPath, f))
|
||||||
|
}
|
||||||
|
m.Ranges = nil
|
||||||
}
|
}
|
||||||
m.Ranges = nil
|
|
||||||
}
|
}
|
||||||
m.Stat.Size = actualSize
|
m.Stat.Size = actualSize
|
||||||
m.Stat.ModTime = UTCNow()
|
m.Stat.ModTime = UTCNow()
|
||||||
|
Loading…
Reference in New Issue
Block a user