top level await, redis error handling, log format

This commit is contained in:
2025-03-12 19:08:20 -07:00
parent 04e1ba3804
commit ca1ad74834
5 changed files with 21 additions and 29 deletions

View File

@@ -17,16 +17,13 @@ if (!process.env["DB_URI"])
const config = seqConfig[process.env["NODE_ENV"]];
const seqConn: Sequelize = new Sequelize(process.env["DB_URI"], config);
// Check connection
(async () => {
try {
await seqConn.authenticate();
logger.info("Sequelize auth success");
} catch (error) {
logger.error("Sequelize auth error", { error });
throw error;
}
})();
try {
await seqConn.authenticate();
logger.info("Sequelize auth success");
} catch (error) {
logger.error("Sequelize auth error", { error });
throw error;
}
// Load models
seqConn.addModels([links, playlists]);