[#230] layer: Change objects_list_cache's key

Remove access_key from objectsListCache key

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2021-08-25 23:03:34 +03:00 committed by Kirillov Denis
parent 04b7958ab3
commit dcac1aa3e3
3 changed files with 4 additions and 9 deletions

View file

@ -572,7 +572,7 @@ func (n *layer) listAllObjects(ctx context.Context, p ListObjectsParamsCommon) (
return nil, err
}
if cacheKey, err = createKey(ctx, bkt.CID, listObjectsMethod, p.Prefix, p.Delimiter); err != nil {
if cacheKey, err = createKey(bkt.CID, listObjectsMethod, p.Prefix, p.Delimiter); err != nil {
return nil, err
}

View file

@ -1,7 +1,6 @@
package layer
import (
"context"
"sync"
"time"
@ -84,14 +83,10 @@ func (l *listObjectsCache) Put(key cacheOptions, objects []*ObjectInfo) {
})
}
func createKey(ctx context.Context, cid *cid.ID, method, prefix, delimiter string) (cacheOptions, error) {
box, err := GetBoxData(ctx)
if err != nil {
return cacheOptions{}, err
}
func createKey(cid *cid.ID, method, prefix, delimiter string) (cacheOptions, error) {
p := cacheOptions{
method: method,
key: box.Gate.AccessKey + cid.String(),
key: cid.String(),
delimiter: delimiter,
prefix: prefix,
}

View file

@ -193,7 +193,7 @@ func (n *layer) ListObjectVersions(ctx context.Context, p *ListObjectVersionsPar
return nil, err
}
cacheKey, err := createKey(ctx, bkt.CID, listVersionsMethod, p.Prefix, p.Delimiter)
cacheKey, err := createKey(bkt.CID, listVersionsMethod, p.Prefix, p.Delimiter)
if err != nil {
return nil, err
}