forked from TrueCloudLab/frostfs-s3-gw
[#547] Cache empty lists without error
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
5984f2c2bc
commit
127b91a97f
1 changed files with 0 additions and 8 deletions
8
api/cache/objectslist.go
vendored
8
api/cache/objectslist.go
vendored
|
@ -96,19 +96,11 @@ func (l *ObjectsListCache) GetVersions(key ObjectsListKey) []*data.NodeVersion {
|
||||||
|
|
||||||
// Put puts a list of objects to cache.
|
// Put puts a list of objects to cache.
|
||||||
func (l *ObjectsListCache) Put(key ObjectsListKey, oids []oid.ID) error {
|
func (l *ObjectsListCache) Put(key ObjectsListKey, oids []oid.ID) error {
|
||||||
if len(oids) == 0 {
|
|
||||||
return fmt.Errorf("list is empty, cid: %s, prefix: %s", key.cid, key.prefix)
|
|
||||||
}
|
|
||||||
|
|
||||||
return l.cache.Set(key, oids)
|
return l.cache.Set(key, oids)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PutVersions puts a list of object versions to cache.
|
// PutVersions puts a list of object versions to cache.
|
||||||
func (l *ObjectsListCache) PutVersions(key ObjectsListKey, versions []*data.NodeVersion) error {
|
func (l *ObjectsListCache) PutVersions(key ObjectsListKey, versions []*data.NodeVersion) error {
|
||||||
if len(versions) == 0 {
|
|
||||||
return fmt.Errorf("list versions is empty, cid: %s, prefix: %s", key.cid, key.prefix)
|
|
||||||
}
|
|
||||||
|
|
||||||
return l.cache.Set(key, versions)
|
return l.cache.Set(key, versions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue