mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-30 22:24:13 +01:00
upgrade buntdb
This commit is contained in:
parent
af124cd964
commit
b6f6959acc
2
go.mod
2
go.mod
@ -17,7 +17,7 @@ require (
|
|||||||
github.com/onsi/ginkgo v1.12.0 // indirect
|
github.com/onsi/ginkgo v1.12.0 // indirect
|
||||||
github.com/onsi/gomega v1.9.0 // indirect
|
github.com/onsi/gomega v1.9.0 // indirect
|
||||||
github.com/stretchr/testify v1.4.0 // indirect
|
github.com/stretchr/testify v1.4.0 // indirect
|
||||||
github.com/tidwall/buntdb v1.3.1
|
github.com/tidwall/buntdb v1.3.2
|
||||||
github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208
|
github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208
|
||||||
github.com/xdg-go/scram v1.0.2
|
github.com/xdg-go/scram v1.0.2
|
||||||
golang.org/x/crypto v0.32.0
|
golang.org/x/crypto v0.32.0
|
||||||
|
2
go.sum
2
go.sum
@ -49,6 +49,8 @@ github.com/tidwall/btree v1.4.2 h1:PpkaieETJMUxYNADsjgtNRcERX7mGc/GP2zp/r5FM3g=
|
|||||||
github.com/tidwall/btree v1.4.2/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE=
|
github.com/tidwall/btree v1.4.2/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE=
|
||||||
github.com/tidwall/buntdb v1.3.1 h1:HKoDF01/aBhl9RjYtbaLnvX9/OuenwvQiC3OP1CcL4o=
|
github.com/tidwall/buntdb v1.3.1 h1:HKoDF01/aBhl9RjYtbaLnvX9/OuenwvQiC3OP1CcL4o=
|
||||||
github.com/tidwall/buntdb v1.3.1/go.mod h1:lZZrZUWzlyDJKlLQ6DKAy53LnG7m5kHyrEHvvcDmBpU=
|
github.com/tidwall/buntdb v1.3.1/go.mod h1:lZZrZUWzlyDJKlLQ6DKAy53LnG7m5kHyrEHvvcDmBpU=
|
||||||
|
github.com/tidwall/buntdb v1.3.2 h1:qd+IpdEGs0pZci37G4jF51+fSKlkuUTMXuHhXL1AkKg=
|
||||||
|
github.com/tidwall/buntdb v1.3.2/go.mod h1:lZZrZUWzlyDJKlLQ6DKAy53LnG7m5kHyrEHvvcDmBpU=
|
||||||
github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw=
|
github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw=
|
||||||
github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
|
15
vendor/github.com/tidwall/buntdb/buntdb.go
generated
vendored
15
vendor/github.com/tidwall/buntdb/buntdb.go
generated
vendored
@ -10,6 +10,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -753,7 +754,7 @@ func (db *DB) Shrink() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Any failures below here are really bad. So just panic.
|
// Any failures below here are really bad. So just panic.
|
||||||
if err := os.Rename(tmpname, fname); err != nil {
|
if err := renameFile(tmpname, fname); err != nil {
|
||||||
panicErr(err)
|
panicErr(err)
|
||||||
}
|
}
|
||||||
db.file, err = os.OpenFile(fname, os.O_CREATE|os.O_RDWR, 0666)
|
db.file, err = os.OpenFile(fname, os.O_CREATE|os.O_RDWR, 0666)
|
||||||
@ -773,6 +774,18 @@ func panicErr(err error) error {
|
|||||||
panic(fmt.Errorf("buntdb: %w", err))
|
panic(fmt.Errorf("buntdb: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func renameFile(src, dest string) error {
|
||||||
|
var err error
|
||||||
|
if err = os.Rename(src, dest); err != nil {
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
if err = os.Remove(dest); err == nil {
|
||||||
|
err = os.Rename(src, dest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// readLoad reads from the reader and loads commands into the database.
|
// readLoad reads from the reader and loads commands into the database.
|
||||||
// modTime is the modified time of the reader, should be no greater than
|
// modTime is the modified time of the reader, should be no greater than
|
||||||
// the current time.Now().
|
// the current time.Now().
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -51,7 +51,7 @@ github.com/okzk/sdnotify
|
|||||||
# github.com/tidwall/btree v1.4.2
|
# github.com/tidwall/btree v1.4.2
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/tidwall/btree
|
github.com/tidwall/btree
|
||||||
# github.com/tidwall/buntdb v1.3.1
|
# github.com/tidwall/buntdb v1.3.2
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/tidwall/buntdb
|
github.com/tidwall/buntdb
|
||||||
# github.com/tidwall/gjson v1.14.3
|
# github.com/tidwall/gjson v1.14.3
|
||||||
|
Loading…
Reference in New Issue
Block a user