Skip to content

Commit

Permalink
Update db.go
Browse files Browse the repository at this point in the history
Co-authored-by: Aoang <aoang@x2oe.com>
  • Loading branch information
vmihailenco and Aoang authored Jan 22, 2025
1 parent 815e11a commit 8f0cb60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ func (db *DB) String() string {
}

func (db *DB) Close() error {
db.closed.Store(true)
if db.closed.Swap(true) {
return nil
}

firstErr := db.DB.Close()

Expand Down

0 comments on commit 8f0cb60

Please sign in to comment.