mirror of
https://github.com/gofiber/storage.git
synced 2025-09-27 12:52:25 +08:00
Merge pull request #1815 from gofiber/codex/2025-07-08-10-51-42
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Bbolt / Tests (1.23.x) (push) Has been cancelled
Tests Bbolt / Tests (1.24.x) (push) Has been cancelled
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Bbolt / Tests (1.23.x) (push) Has been cancelled
Tests Bbolt / Tests (1.24.x) (push) Has been cancelled
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"github.com/gofiber/utils/v2"
|
"github.com/gofiber/utils/v2"
|
||||||
"go.etcd.io/bbolt"
|
"go.etcd.io/bbolt"
|
||||||
|
berrors "go.etcd.io/bbolt/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func createBucket(cfg Config, conn *bbolt.DB) error {
|
func createBucket(cfg Config, conn *bbolt.DB) error {
|
||||||
@@ -17,7 +18,7 @@ func createBucket(cfg Config, conn *bbolt.DB) error {
|
|||||||
func removeBucket(cfg Config, conn *bbolt.DB) error {
|
func removeBucket(cfg Config, conn *bbolt.DB) error {
|
||||||
return conn.Update(func(tx *bbolt.Tx) error {
|
return conn.Update(func(tx *bbolt.Tx) error {
|
||||||
err := tx.DeleteBucket(utils.UnsafeBytes(cfg.Bucket))
|
err := tx.DeleteBucket(utils.UnsafeBytes(cfg.Bucket))
|
||||||
if errors.Is(err, bbolt.ErrBucketNotFound) {
|
if errors.Is(err, berrors.ErrBucketNotFound) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user