From bafab795d101d842cc08bea3982c4c2c761ff50b Mon Sep 17 00:00:00 2001 From: Adrien Aury <44274230+adrienaury@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:56:09 +0000 Subject: [PATCH] perf(dump): try without snapshot --- internal/infra/backend.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/infra/backend.go b/internal/infra/backend.go index 3352271..eed534f 100644 --- a/internal/infra/backend.go +++ b/internal/infra/backend.go @@ -68,7 +68,7 @@ func encode(items []silo.DataNode) ([]byte, error) { } type Snapshot struct { - db *pebble.Batch + db *pebble.DB } func (s Snapshot) Next() (silo.DataNode, bool, error) { @@ -120,10 +120,6 @@ func (s Snapshot) PullAll(node silo.DataNode) ([]silo.DataNode, error) { } func (s Snapshot) Close() error { - if err := s.db.Close(); err != nil { - return fmt.Errorf("%w", err) - } - return nil } @@ -175,7 +171,7 @@ func (b Backend) Store(key silo.DataNode, value silo.DataNode) error { } func (b Backend) Snapshot() silo.Snapshot { //nolint:ireturn - return Snapshot{b.db.NewIndexedBatch()} + return Snapshot(b) } func (b Backend) Close() error {