Skip to content

Commit

Permalink
Fix duplicate close in write benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed May 26, 2019
1 parent f399ce5 commit c07deef
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions benchmarks/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ exports.run = function (factory, stream, options) {
}

function write () {
if (totalWrites++ === options.n) {
db.close(function () {
report(Date.now() - startTime)
})
}

if (totalWrites++ === options.n) return report(Date.now() - startTime)
if (inProgress >= options.concurrency || totalWrites > options.n) return

inProgress++
Expand Down

0 comments on commit c07deef

Please sign in to comment.