Skip to content
Permalink
Browse files
[misc] avoid validating all pool connection on benchmark end
  • Loading branch information
rusher committed Aug 25, 2018
1 parent 0869c96 commit 64ce336
Showing 1 changed file with 3 additions and 2 deletions.
@@ -36,7 +36,7 @@ try {
function Bench() {
this.dbReady = 0;
this.reportData = {};

this.ended = false;
this.driverLen = 2;

this.ready = 0;
@@ -197,7 +197,7 @@ function Bench() {

// called between running benchmarks
onCycle: function(event) {
pingAll(connList);
if (!this.ended) pingAll(connList);
//to avoid mysql2 taking all the server memory
if (promiseMysql2 && promiseMysql2.clearParserCache) promiseMysql2.clearParserCache();
if (mysql2 && mysql2.clearParserCache) mysql2.clearParserCache();
@@ -223,6 +223,7 @@ function Bench() {
onComplete: function() {
console.log("completed");
bench.end(bench);
this.ended = true;
}
});
}

0 comments on commit 64ce336

Please sign in to comment.