close db write batch after use (#4379)

Closes: #4381
This commit is contained in:
Yumin Xia 2019-05-21 17:42:33 -07:00 committed by Alessio Treglia
parent 995aea853c
commit 65be4dbf09
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
#4379 close db write batch.

View File

@ -198,6 +198,7 @@ func (rs *Store) Commit() types.CommitID {
// Need to update atomically.
batch := rs.db.NewBatch()
defer batch.Close()
setCommitInfo(batch, version, commitInfo)
setLatestVersion(batch, version)
batch.Write()