From 072e694540bd33feae388300c444ce917d71f356 Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Fri, 5 Aug 2022 06:19:17 +0400 Subject: [PATCH] [#643] Optimize GetObjectTagging Signed-off-by: Angira Kekteeva --- api/layer/tagging.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/layer/tagging.go b/api/layer/tagging.go index 3d7159fd4..0e898d34a 100644 --- a/api/layer/tagging.go +++ b/api/layer/tagging.go @@ -16,6 +16,13 @@ func (n *layer) GetObjectTagging(ctx context.Context, p *ObjectVersion) (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) if err != nil { return "", nil, err