aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--config/default.yaml2
-rw-r--r--config/production.yaml.example2
-rw-r--r--server/initializers/checker.ts2
-rw-r--r--server/initializers/constants.ts5
-rw-r--r--server/initializers/database.ts4
5 files changed, 13 insertions, 2 deletions
diff --git a/config/default.yaml b/config/default.yaml
index bc0530d79..3b877476d 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -22,6 +22,8 @@ database:
22 suffix: '_dev' 22 suffix: '_dev'
23 username: 'peertube' 23 username: 'peertube'
24 password: 'peertube' 24 password: 'peertube'
25 pool:
26 max: 5
25 27
26# You can also specify a 'socket' path to a unix socket but first need to 28# You can also specify a 'socket' path to a unix socket but first need to
27# comment out hostname and port 29# comment out hostname and port
diff --git a/config/production.yaml.example b/config/production.yaml.example
index d347b0ece..6087e78be 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -21,6 +21,8 @@ database:
21 suffix: '_prod' 21 suffix: '_prod'
22 username: 'peertube' 22 username: 'peertube'
23 password: 'peertube' 23 password: 'peertube'
24 pool:
25 max: 5
24 26
25# Redis server for short time storage 27# Redis server for short time storage
26# You can also specify a 'socket' path to a unix socket but first need to 28# You can also specify a 'socket' path to a unix socket but first need to
diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts
index 52a1aeb50..270cbf649 100644
--- a/server/initializers/checker.ts
+++ b/server/initializers/checker.ts
@@ -43,7 +43,7 @@ function checkMissedConfig () {
43 const required = [ 'listen.port', 'listen.hostname', 43 const required = [ 'listen.port', 'listen.hostname',
44 'webserver.https', 'webserver.hostname', 'webserver.port', 44 'webserver.https', 'webserver.hostname', 'webserver.port',
45 'trust_proxy', 45 'trust_proxy',
46 'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password', 46 'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password', 'database.pool.max',
47 'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address', 47 'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address',
48 'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache', 48 'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache',
49 'log.level', 49 'log.level',
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 3aa979668..6256cf38e 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -121,7 +121,10 @@ const CONFIG = {
121 HOSTNAME: config.get<string>('database.hostname'), 121 HOSTNAME: config.get<string>('database.hostname'),
122 PORT: config.get<number>('database.port'), 122 PORT: config.get<number>('database.port'),
123 USERNAME: config.get<string>('database.username'), 123 USERNAME: config.get<string>('database.username'),
124 PASSWORD: config.get<string>('database.password') 124 PASSWORD: config.get<string>('database.password'),
125 POOL: {
126 MAX: config.get<number>('database.pool.max')
127 }
125 }, 128 },
126 REDIS: { 129 REDIS: {
127 HOSTNAME: config.has('redis.hostname') ? config.get<string>('redis.hostname') : null, 130 HOSTNAME: config.has('redis.hostname') ? config.get<string>('redis.hostname') : null,
diff --git a/server/initializers/database.ts b/server/initializers/database.ts
index 1a9ce5a61..21c083084 100644
--- a/server/initializers/database.ts
+++ b/server/initializers/database.ts
@@ -32,6 +32,7 @@ const username = CONFIG.DATABASE.USERNAME
32const password = CONFIG.DATABASE.PASSWORD 32const password = CONFIG.DATABASE.PASSWORD
33const host = CONFIG.DATABASE.HOSTNAME 33const host = CONFIG.DATABASE.HOSTNAME
34const port = CONFIG.DATABASE.PORT 34const port = CONFIG.DATABASE.PORT
35const poolMax = CONFIG.DATABASE.POOL.MAX
35 36
36const sequelizeTypescript = new SequelizeTypescript({ 37const sequelizeTypescript = new SequelizeTypescript({
37 database: dbname, 38 database: dbname,
@@ -40,6 +41,9 @@ const sequelizeTypescript = new SequelizeTypescript({
40 port, 41 port,
41 username, 42 username,
42 password, 43 password,
44 pool: {
45 max: poolMax
46 },
43 benchmark: isTestInstance(), 47 benchmark: isTestInstance(),
44 isolationLevel: SequelizeTypescript.Transaction.ISOLATION_LEVELS.SERIALIZABLE, 48 isolationLevel: SequelizeTypescript.Transaction.ISOLATION_LEVELS.SERIALIZABLE,
45 operatorsAliases: false, 49 operatorsAliases: false,