[#643] Fix tagging cache

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-08-04 01:26:14 +04:00 committed by Kirillov Denis
parent bb14041f52
commit 9372534345

View file

@ -16,17 +16,17 @@ func (n *layer) GetObjectTagging(ctx context.Context, p *ObjectVersion) (string,
tags map[string]string tags map[string]string
) )
tags = n.systemCache.GetTagging(objectTaggingCacheKey(p))
if tags != nil {
return p.VersionID, tags, nil
}
version, err := n.getNodeVersion(ctx, p) version, err := n.getNodeVersion(ctx, p)
if err != nil { if err != nil {
return "", nil, err return "", nil, err
} }
p.VersionID = version.OID.EncodeToString() p.VersionID = version.OID.EncodeToString()
tags = n.systemCache.GetTagging(objectTaggingCacheKey(p))
if tags != nil {
return p.VersionID, tags, nil
}
tags, err = n.treeService.GetObjectTagging(ctx, p.BktInfo.CID, version) tags, err = n.treeService.GetObjectTagging(ctx, p.BktInfo.CID, version)
if err != nil { if err != nil {
if errorsStd.Is(err, ErrNodeNotFound) { if errorsStd.Is(err, ErrNodeNotFound) {