From a4aae4a6e2959f188982893b4d241fc18b767103 Mon Sep 17 00:00:00 2001 From: cosmo Date: Thu, 27 Jun 2024 21:06:33 +0800 Subject: [PATCH] beta440 --- idmap/service.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/idmap/service.go b/idmap/service.go index 6b9334a7..bca6c94a 100644 --- a/idmap/service.go +++ b/idmap/service.go @@ -72,15 +72,8 @@ func InitializeDB() { } func ClearBucket(bucketName string) { - // 打开数据库文件 - db, err := bbolt.Open(DBName, 0600, nil) - if err != nil { - log.Fatalf("Error opening DB: %v", err) - } - defer db.Close() - // 清空指定的bucket - err = db.Update(func(tx *bbolt.Tx) error { + err := db.Update(func(tx *bbolt.Tx) error { // 获取指定的bucket bucket := tx.Bucket([]byte(bucketName)) if bucket == nil {