diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-24 11:33:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-24 11:34:15 +0200 |
commit | 4f24f16e27d942b063c945dde55b902572b7dee7 (patch) | |
tree | 8c8c8bac5274c91549f62844dd58666b3ea45d01 /server/initializers/database.ts | |
parent | cf649c2ed918b3cc6bd4c92f38c7752174ac1e9a (diff) | |
download | PeerTube-4f24f16e27d942b063c945dde55b902572b7dee7.tar.gz PeerTube-4f24f16e27d942b063c945dde55b902572b7dee7.tar.zst PeerTube-4f24f16e27d942b063c945dde55b902572b7dee7.zip |
Better error message on postgresql connection err
Diffstat (limited to 'server/initializers/database.ts')
-rw-r--r-- | server/initializers/database.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/initializers/database.ts b/server/initializers/database.ts index 8ce32f6fa..5cf5765f6 100644 --- a/server/initializers/database.ts +++ b/server/initializers/database.ts | |||
@@ -75,6 +75,14 @@ const sequelizeTypescript = new SequelizeTypescript({ | |||
75 | } | 75 | } |
76 | }) | 76 | }) |
77 | 77 | ||
78 | sequelizeTypescript.authenticate() | ||
79 | .then(() => logger.debug('Connection to PostgreSQL has been established successfully.')) | ||
80 | .catch(err => { | ||
81 | |||
82 | logger.error('Unable to connect to PostgreSQL database.', { err }) | ||
83 | process.exit(-1) | ||
84 | }) | ||
85 | |||
78 | async function initDatabaseModels (silent: boolean) { | 86 | async function initDatabaseModels (silent: boolean) { |
79 | sequelizeTypescript.addModels([ | 87 | sequelizeTypescript.addModels([ |
80 | ApplicationModel, | 88 | ApplicationModel, |