mirror of
https://github.com/minio/minio.git
synced 2025-01-12 07:23:23 -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
|
return cacheReader, nil
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
if _, ok := err.(ObjectNotFound); ok {
|
if _, ok := err.(ObjectNotFound); ok {
|
||||||
cacheReader.Close()
|
if cacheErr == nil {
|
||||||
// Delete cached entry if backend object was deleted.
|
cacheReader.Close()
|
||||||
dcache.Delete(ctx, bucket, object)
|
// Delete cached entry if backend object
|
||||||
|
// was deleted.
|
||||||
|
dcache.Delete(ctx, bucket, object)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user