close db write batch after use (#4379)

Closes: #4381
This commit is contained in:
Yumin Xia
2019-05-22 01:42:33 +01:00
committed by Alessio Treglia
parent 995aea853c
commit 65be4dbf09
2 changed files with 2 additions and 0 deletions
+1
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()