Close waits for the transactions to finish

DB.Close() actually waits for the transactions to finish now, since the PR 377.
https://github.com/boltdb/bolt/pull/377
pull/80/head
Rodrigo Coelho 2018-02-13 20:02:24 -02:00 committed by GitHub
parent ee30b748bc
commit fafe4b70b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

2
db.go
View File

@ -441,7 +441,7 @@ 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()