This commit is contained in:
Jay 2020-04-20 10:03:22 +08:00
parent aa68871e8d
commit c726a94227
1 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,10 @@ func SetRoutes(e *gin.Engine) {
var list []string = make([]string, 0)
db := database.Get()
err := db.View(func(tx *bbolt.Tx) error {
bucket := tx.Bucket([]byte("led"))
bucket, err := tx.CreateBucketIfNotExists([]byte("led"))
if err != nil {
return err
}
if b := bucket.Get([]byte("project")); b == nil {
return nil
} else {