mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 00:03:29 +03: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:
+4
-1
@@ -200,10 +200,13 @@ 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 {
|
||||||
|
if cacheErr == nil {
|
||||||
cacheReader.Close()
|
cacheReader.Close()
|
||||||
// Delete cached entry if backend object was deleted.
|
// Delete cached entry if backend object
|
||||||
|
// was deleted.
|
||||||
dcache.Delete(ctx, bucket, object)
|
dcache.Delete(ctx, bucket, object)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user