From 127b91a97faa2af308c970bf521166a80379bdd5 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Fri, 24 Jun 2022 11:27:32 +0300 Subject: [PATCH] [#547] Cache empty lists without error Signed-off-by: Denis Kirillov --- api/cache/objectslist.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/api/cache/objectslist.go b/api/cache/objectslist.go index 6fbcd74..97ca323 100644 --- a/api/cache/objectslist.go +++ b/api/cache/objectslist.go @@ -96,19 +96,11 @@ func (l *ObjectsListCache) GetVersions(key ObjectsListKey) []*data.NodeVersion { // Put puts a list of objects to cache. 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) } // PutVersions puts a list of object versions to cache. 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) }