We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 401b5d0 commit 3834cfdCopy full SHA for 3834cfd
1 file changed
block/internal/cache/generic_cache.go
@@ -3,11 +3,13 @@ package cache
3
import (
4
"context"
5
"encoding/binary"
6
+ "errors"
7
"fmt"
8
"sync"
9
"sync/atomic"
10
11
lru "github.com/hashicorp/golang-lru/v2"
12
+ ds "github.com/ipfs/go-datastore"
13
14
"github.com/evstack/ev-node/pkg/store"
15
)
@@ -266,7 +268,10 @@ func (c *Cache[T]) RestoreFromStore(ctx context.Context) error {
266
268
267
269
buf, err := c.store.GetMetadata(ctx, c.snapshotKey())
270
if err != nil {
- return nil //nolint:nilerr // key absent = nothing to restore
271
+ if errors.Is(err, ds.ErrNotFound) {
272
+ return nil // key absent = fresh node or pre-snapshot version, nothing to restore
273
+ }
274
+ return fmt.Errorf("reading cache snapshot from store: %w", err)
275
}
276
277
for _, e := range decodeSnapshot(buf) {
0 commit comments