aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/database.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-24 11:33:59 +0200
committerChocobozzz <me@florianbigard.com>2020-08-24 11:34:15 +0200
commit4f24f16e27d942b063c945dde55b902572b7dee7 (patch)
tree8c8c8bac5274c91549f62844dd58666b3ea45d01 /server/initializers/database.ts
parentcf649c2ed918b3cc6bd4c92f38c7752174ac1e9a (diff)
downloadPeerTube-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.ts8
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
78sequelizeTypescript.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
78async function initDatabaseModels (silent: boolean) { 86async function initDatabaseModels (silent: boolean) {
79 sequelizeTypescript.addModels([ 87 sequelizeTypescript.addModels([
80 ApplicationModel, 88 ApplicationModel,