fix(be): boltdb backet validation

This commit is contained in:
Denis Gukov 2021-05-13 19:33:04 +05:00
parent b0d0561966
commit 0e7c8b7f63
3 changed files with 9 additions and 2 deletions

BIN
192.168.185.10:3306 Normal file

Binary file not shown.

View File

@ -216,6 +216,10 @@ func (d *BoltDb) getObjects(bucketID int, props db.ObjectProperties, params db.R
return d.db.View(func(tx *bbolt.Tx) error {
b := tx.Bucket(makeBucketId(props, bucketID))
if b == nil {
return db.ErrNotFound
}
c := b.Cursor()
return unmarshalObjects(c, props, params, filter, objects)

View File

@ -2,9 +2,12 @@ package factory
import (
"github.com/ansible-semaphore/semaphore/db"
"github.com/ansible-semaphore/semaphore/db/sql"
"github.com/ansible-semaphore/semaphore/db/bolt"
//"github.com/ansible-semaphore/semaphore/db/sql"
)
func CreateStore() db.Store {
return &sql.SqlDb{}
return &bolt.BoltDb{}
//return &sql.SqlDb{}
}