diff --git a/api/layer/object.go b/api/layer/object.go index b18c12cd5..92016bc20 100644 --- a/api/layer/object.go +++ b/api/layer/object.go @@ -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 } diff --git a/api/layer/object_list_cache.go b/api/layer/object_list_cache.go index 18e562ce4..16776d4e3 100644 --- a/api/layer/object_list_cache.go +++ b/api/layer/object_list_cache.go @@ -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, } diff --git a/api/layer/versioning.go b/api/layer/versioning.go index 20e5219a0..fac349402 100644 --- a/api/layer/versioning.go +++ b/api/layer/versioning.go @@ -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 }