mirror of https://github.com/calzoneman/sync.git
database: exit if initial connection fails (#500)
This commit is contained in:
parent
f2000b4459
commit
bb3b9004e0
|
@ -24,10 +24,9 @@ module.exports.init = function () {
|
||||||
|
|
||||||
// Test the connection
|
// Test the connection
|
||||||
pool.getConnection(function (err, conn) {
|
pool.getConnection(function (err, conn) {
|
||||||
if(err) {
|
if (err) {
|
||||||
Logger.errlog.log("! DB connection failed");
|
Logger.errlog.log("Initial database connection failed: " + err.stack);
|
||||||
Logger.errlog.log(err);
|
process.exit(1);
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
tables.init(module.exports.query, function (err) {
|
tables.init(module.exports.query, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in New Issue