MustReopen reopen the database. Panic on error.
()
| 120 | |
| 121 | // MustReopen reopen the database. Panic on error. |
| 122 | func (db *DB) MustReopen() { |
| 123 | if db.DB != nil { |
| 124 | panic("Please call Close() before MustReopen()") |
| 125 | } |
| 126 | db.t.Logf("Reopening bbolt DB at: %s", db.f) |
| 127 | indb, err := bolt.Open(db.Path(), 0600, db.o) |
| 128 | require.NoError(db.t, err) |
| 129 | db.DB = indb |
| 130 | db.strictModeEnabledDefault() |
| 131 | } |
| 132 | |
| 133 | // MustCheck runs a consistency check on the database and panics if any errors are found. |
| 134 | func (db *DB) MustCheck() { |