Purge stale object cache entry (#2770)

This commit is contained in:
Krishnan Parthasarathi
2016-09-23 19:55:28 -07:00
committed by Harshavardhana
parent 27e474b3d2
commit 669783f875
3 changed files with 38 additions and 6 deletions

View File

@@ -121,7 +121,7 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64, length i
if xlMeta.Stat.Size > 0 && xl.objCacheEnabled {
// Validate if we have previous cache.
var cachedBuffer io.ReadSeeker
cachedBuffer, err = xl.objCache.Open(path.Join(bucket, object))
cachedBuffer, err = xl.objCache.Open(path.Join(bucket, object), modTime)
if err == nil { // Cache hit.
// Advance the buffer to offset as if it was read.
if _, err = cachedBuffer.Seek(startOffset, 0); err != nil { // Seek to the offset.