From aefcf17734a4b2ea25c9191ec80465c8307209b1 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 6 Feb 2025 17:12:36 -0300 Subject: src/dedo.go: Remove StrictMode field from DB type --- src/dedo.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/dedo.go b/src/dedo.go index 8ebc4c4..84c4cea 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -49,7 +49,6 @@ import ( "log" "os" "sort" - "strings" "sync" "syscall" "time" @@ -110,12 +109,6 @@ type elemRef struct { /// DB. All the functions on DB will return a ErrDatabaseNotOpen if accessed /// before Open() is called. type DB struct { - /// When enabled, the database will perform a Check() after every - /// commit. A panic is issued if the database is in an inconsistent - /// state. This flag has a large performance impact so it should only - /// be used for debugging purposes. - StrictMode bool - /// MaxBatchSize is the maximum size of a batch. Default value is /// copied from DefaultMaxBatchSize in Open. /// @@ -3454,23 +3447,6 @@ func (tx *Tx) commit() error { return err } - // If strict mode is enabled then perform a consistency check. - // Only the first consistency error is reported in the panic. - if tx.db.StrictMode { - ch := tx.Check() - errs := []string{} - for { - err, ok := <-ch - if !ok { - break - } - errs = append(errs, err.Error()) - } - if len(errs) > 0 { - panic("check fail: " + strings.Join(errs, "\n")) - } - } - // Write meta to disk. err = tx.writeMeta() if err != nil { -- cgit v1.2.3