forked from TrueCloudLab/frostfs-s3-gw
[#542] Clear list cache on object removal
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
f1a0288e3a
commit
b380d4ab53
2 changed files with 32 additions and 0 deletions
|
@ -486,6 +486,7 @@ func (n *layer) deleteObject(ctx context.Context, bkt *data.BucketInfo, settings
|
|||
}
|
||||
|
||||
obj.Error = n.treeService.RemoveVersion(ctx, bkt.CID, nodeVersion.ID)
|
||||
n.listsCache.CleanCacheEntriesContainingObject(obj.Name, bkt.CID)
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -528,7 +529,9 @@ func (n *layer) deleteObject(ctx context.Context, bkt *data.BucketInfo, settings
|
|||
if obj.Error = n.treeService.AddVersion(ctx, bkt.CID, newVersion); obj.Error != nil {
|
||||
return obj
|
||||
}
|
||||
|
||||
n.namesCache.Delete(bkt.Name + "/" + obj.Name)
|
||||
n.listsCache.CleanCacheEntriesContainingObject(obj.Name, bkt.CID)
|
||||
|
||||
return obj
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue