Skip to content

Commit

Permalink
fix(be): do not panic in boltdb connection
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Aug 28, 2023
1 parent b5a99eb commit 37e7c4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions db/bolt/BoltDb.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ func (d *BoltDb) Connect(token string) {
}

if _, exists := d.connections[token]; exists {
panic(fmt.Errorf("Connection " + token + " already exists"))
// Use for debugging
//panic(fmt.Errorf("Connection " + token + " already exists"))
}

if len(d.connections) > 0 {
Expand Down Expand Up @@ -120,7 +121,8 @@ func (d *BoltDb) Close(token string) {
_, exists := d.connections[token]

if !exists {
panic(fmt.Errorf("can not close closed connection " + token))
// Use for debugging
//panic(fmt.Errorf("can not close closed connection " + token))
}

if len(d.connections) > 1 {
Expand Down

0 comments on commit 37e7c4a

Please sign in to comment.