Skip to content

Commit

Permalink
fix(be): boltdb backet validation
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed May 13, 2021
1 parent b0d0561 commit 0e7c8b7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Binary file added 192.168.185.10:3306
Binary file not shown.
4 changes: 4 additions & 0 deletions db/bolt/BoltDb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions db/factory/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}

0 comments on commit 0e7c8b7

Please sign in to comment.