From fafe4b70b5ce332dce497c79d94088b7f2b32404 Mon Sep 17 00:00:00 2001 From: Rodrigo Coelho Date: Tue, 13 Feb 2018 20:02:24 -0200 Subject: [PATCH 1/2] 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 --- db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.go b/db.go index 4c8c156b2..88c138952 100644 --- a/db.go +++ b/db.go @@ -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() From 584b1a3dba1e7f9aee15721001bf981011e6a232 Mon Sep 17 00:00:00 2001 From: Rodrigo Coelho Date: Wed, 14 Feb 2018 10:06:29 -0200 Subject: [PATCH 2/2] Breaking the long line --- db.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db.go b/db.go index 88c138952..d5c53f4a2 100644 --- a/db.go +++ b/db.go @@ -441,7 +441,8 @@ func (db *DB) init() error { } // Close releases all database resources. -// It will block waiting for any open transactions to finish before closing the database and returning. +// 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()