MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Repair

Method Repair

driver/badger/store.go:52–72  ·  view source on GitHub ↗
(path string, cfg *config.Config)

Source from the content-addressed store, hash-verified

50}
51
52func (s Store) Repair(path string, cfg *config.Config) error {
53 // Open database with default options
54 db, err := badger.Open(badger.DefaultOptions(path))
55 if err != nil {
56 return err
57 }
58 defer db.Close()
59
60 // Run value log GC to clean up any corrupted data
61 for {
62 err := db.RunValueLogGC(0.7)
63 if err == badger.ErrNoRewrite {
64 break
65 }
66 if err != nil {
67 return err
68 }
69 }
70
71 return nil
72}

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected