mirror of https://github.com/etcd-io/bbolt.git
test: perform check in view(readonly) mode
Signed-off-by: Benjamin Wang <wachao@vmware.com>pull/431/head
parent
0c2c0a257a
commit
b91d901b74
|
@ -117,7 +117,7 @@ func (db *DB) MustReopen() {
|
||||||
|
|
||||||
// MustCheck runs a consistency check on the database and panics if any errors are found.
|
// MustCheck runs a consistency check on the database and panics if any errors are found.
|
||||||
func (db *DB) MustCheck() {
|
func (db *DB) MustCheck() {
|
||||||
err := db.Update(func(tx *bolt.Tx) error {
|
err := db.View(func(tx *bolt.Tx) error {
|
||||||
// Collect all the errors.
|
// Collect all the errors.
|
||||||
var errors []error
|
var errors []error
|
||||||
for err := range tx.Check() {
|
for err := range tx.Check() {
|
||||||
|
|
Loading…
Reference in New Issue