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