Skip to content

Commit

Permalink
Merge pull request #80 from rcoelho/close-wait-transactions
Browse files Browse the repository at this point in the history
Close waits for the transactions to finish
  • Loading branch information
xiang90 authored Feb 14, 2018
2 parents ee30b74 + 584b1a3 commit b44cfbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@ func (db *DB) init() error {
}

// Close releases all database resources.
// All transactions must be closed before closing the database.
// It will block waiting for any open transactions to finish
// before closing the database and returning.
func (db *DB) Close() error {
db.rwlock.Lock()
defer db.rwlock.Unlock()
Expand Down

0 comments on commit b44cfbd

Please sign in to comment.