javascript - How to resolve mysql queryAsync (promisify pool) until result will not complete? -


i'm working bluebird promises lib

old code looks this:

var sql1 = this.pool.queryasync("1.sql").get(0); var sql2 = this.pool.queryasync("2.sql").get(0); var sql3 = this.pool.queryasync("3.sql").get(0);  return promise.join(sql1, sql2, sql3, function (sql1result, sql2result, sql3result) {       //fetching results.. }); 

now need cancel perform queries if result full. speaking:

var commonresult = [];  while(commonresult.length < 20) {  commonresult.push(sqlresult); } 


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

android - Go back to previous fragment -