Skip to content

Commit bafab79

Browse files
committed
perf(dump): try without snapshot
1 parent ba2a17c commit bafab79

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/infra/backend.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func encode(items []silo.DataNode) ([]byte, error) {
6868
}
6969

7070
type Snapshot struct {
71-
db *pebble.Batch
71+
db *pebble.DB
7272
}
7373

7474
func (s Snapshot) Next() (silo.DataNode, bool, error) {
@@ -120,10 +120,6 @@ func (s Snapshot) PullAll(node silo.DataNode) ([]silo.DataNode, error) {
120120
}
121121

122122
func (s Snapshot) Close() error {
123-
if err := s.db.Close(); err != nil {
124-
return fmt.Errorf("%w", err)
125-
}
126-
127123
return nil
128124
}
129125

@@ -175,7 +171,7 @@ func (b Backend) Store(key silo.DataNode, value silo.DataNode) error {
175171
}
176172

177173
func (b Backend) Snapshot() silo.Snapshot { //nolint:ireturn
178-
return Snapshot{b.db.NewIndexedBatch()}
174+
return Snapshot(b)
179175
}
180176

181177
func (b Backend) Close() error {

0 commit comments

Comments
 (0)