I can not get return data from mysql connection check function at nodejs. Output is always false.
var dbcheck = false;
connection.connect(function (err) {
if(err) {
dialog.showMessageBox(null,dbOptions, function (response) {
if(response == 1){
shell.openExternal("https://innoscript.co");
app.quit();
}
if(response == 0){ app.quit(); }
});
}
if(!err){
dbcheck = true;
return dbcheck;
}
});
console.log(dbcheck);