Possibly fix startup?
This commit is contained in:
parent
dea283fd07
commit
e50968e0c1
17
index.js
17
index.js
|
@ -78,19 +78,10 @@ app.listen(port, host, (err) => {
|
||||||
}
|
}
|
||||||
global.log.info(`Listening on port ${host}:${port}`);
|
global.log.info(`Listening on port ${host}:${port}`);
|
||||||
global.log.debug(`DSN: ${DSN}`);
|
global.log.debug(`DSN: ${DSN}`);
|
||||||
db.getConnection()
|
db.query("SELECT * FROM ACL LIMIT 1;")
|
||||||
.then(conn => {
|
.then(() => {
|
||||||
return conn.query('SELECT 1 FROM ACL LIMIT 1')
|
dbReady = true;
|
||||||
.then(() => {
|
global.log.info("Database connection established");
|
||||||
global.log.info('Database connection validated with ACL table.');
|
|
||||||
dbReady = true;
|
|
||||||
conn.release();
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
global.log.error(`Database ACL validation failed: ${err}`);
|
|
||||||
conn.release();
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
global.log.error(`Database connection failed: ${err}`);
|
global.log.error(`Database connection failed: ${err}`);
|
||||||
|
|
Loading…
Reference in a new issue