Skip to content

Commit

Permalink
perf(dump): try without snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienaury committed Mar 27, 2024
1 parent ba2a17c commit bafab79
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/infra/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit bafab79

Please sign in to comment.