Comparing version 0.0.5 to 0.0.6
26
index.js
@@ -99,13 +99,16 @@ const mysql = require('mysql'); | ||
return new Promise((resolve, reject) => { | ||
this.connection.connect((err) => { | ||
if (err) | ||
if (typeof reconnectOnError === "number" && reconnectOnError > 500) | ||
setTimeout(() => { | ||
this.connect(reconnectOnError); | ||
}, reconnectOnError); | ||
else | ||
return reject(["__DB_CONNECT_ERROR__", err]); | ||
return resolve(true); | ||
this.connection.connect((err) => { | ||
if (err) | ||
if (typeof reconnectOnError === "number" && reconnectOnError > 500) | ||
resolve(new Promise((resolve, reject) => { | ||
setTimeout(() => { | ||
this.connect(reconnectOnError).then(resolve).catch(reject); | ||
}, reconnectOnError); | ||
})); | ||
else | ||
return reject(["__DB_CONNECT_ERROR__", err]); | ||
return resolve(true); | ||
}); | ||
}); | ||
}); | ||
} | ||
@@ -130,3 +133,4 @@ | ||
async selectAll([table, condition, params], callback) { | ||
return await this.select(["*", table, condition, params], callback); | ||
return await | ||
this.select(["*", table, condition, params], callback); | ||
} | ||
@@ -133,0 +137,0 @@ |
{ | ||
"name": "amysql", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Useless wrapper over mysql", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12178
258