mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
do not try to delete non-existent object in cache (#7560)
handle cache cleanup correctly when backend object was deleted. Fixes: #7558
This commit is contained in:
parent
816459d10f
commit
2c096c569f
@ -200,9 +200,12 @@ func (c cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string,
|
||||
return cacheReader, nil
|
||||
} else if err != nil {
|
||||
if _, ok := err.(ObjectNotFound); ok {
|
||||
cacheReader.Close()
|
||||
// Delete cached entry if backend object was deleted.
|
||||
dcache.Delete(ctx, bucket, object)
|
||||
if cacheErr == nil {
|
||||
cacheReader.Close()
|
||||
// Delete cached entry if backend object
|
||||
// was deleted.
|
||||
dcache.Delete(ctx, bucket, object)
|
||||
}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user