[#643] Optimize GetObjectTagging

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-08-05 06:19:17 +04:00 committed by Kirillov Denis
parent 9372534345
commit 072e694540

View file

@ -16,6 +16,13 @@ func (n *layer) GetObjectTagging(ctx context.Context, p *ObjectVersion) (string,
tags map[string]string tags map[string]string
) )
if len(p.VersionID) != 0 && p.VersionID != UnversionedObjectVersionID {
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