fix: update sequelize check fail
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Sequelize } from 'sequelize';
|
||||
import { config } from './config.ts';
|
||||
import { log } from '../logger/index.ts';
|
||||
export type PostgresConfig = {
|
||||
postgres: {
|
||||
username: string;
|
||||
@@ -26,3 +27,13 @@ export const sequelize = new Sequelize({
|
||||
...postgresConfig,
|
||||
// logging: false,
|
||||
});
|
||||
|
||||
sequelize
|
||||
.authenticate({ logging: false })
|
||||
.then(() => {
|
||||
log.info('Database connected');
|
||||
})
|
||||
.catch((err) => {
|
||||
log.error('Database connection failed', { err, config: postgresConfig });
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user