aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/database.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/initializers/database.js b/server/initializers/database.js
index cc6f59b63..9642231b9 100644
--- a/server/initializers/database.js
+++ b/server/initializers/database.js
@@ -6,13 +6,24 @@ const Sequelize = require('sequelize')
6 6
7const constants = require('../initializers/constants') 7const constants = require('../initializers/constants')
8const logger = require('../helpers/logger') 8const logger = require('../helpers/logger')
9const utils = require('../helpers/utils')
9 10
10const database = {} 11const database = {}
11 12
12const sequelize = new Sequelize(constants.CONFIG.DATABASE.DBNAME, 'peertube', 'peertube', { 13const sequelize = new Sequelize(constants.CONFIG.DATABASE.DBNAME, 'peertube', 'peertube', {
13 dialect: 'postgres', 14 dialect: 'postgres',
14 host: constants.CONFIG.DATABASE.HOSTNAME, 15 host: constants.CONFIG.DATABASE.HOSTNAME,
15 port: constants.CONFIG.DATABASE.PORT 16 port: constants.CONFIG.DATABASE.PORT,
17 benchmark: utils.isTestInstance(),
18
19 logging: function (message, benchmark) {
20 let newMessage = message
21 if (benchmark !== undefined) {
22 newMessage += ' | ' + benchmark + 'ms'
23 }
24
25 logger.debug(newMessage)
26 }
16}) 27})
17 28
18const modelDirectory = path.join(__dirname, '..', 'models') 29const modelDirectory = path.join(__dirname, '..', 'models')