mirror of https://github.com/Chocobozzz/PeerTube
adding ORM pool configuration
parent
040467f5c8
commit
1c3386e87f
|
@ -22,6 +22,8 @@ database:
|
||||||
suffix: '_dev'
|
suffix: '_dev'
|
||||||
username: 'peertube'
|
username: 'peertube'
|
||||||
password: 'peertube'
|
password: 'peertube'
|
||||||
|
pool:
|
||||||
|
max: 5
|
||||||
|
|
||||||
# You can also specify a 'socket' path to a unix socket but first need to
|
# You can also specify a 'socket' path to a unix socket but first need to
|
||||||
# comment out hostname and port
|
# comment out hostname and port
|
||||||
|
|
|
@ -21,6 +21,8 @@ database:
|
||||||
suffix: '_prod'
|
suffix: '_prod'
|
||||||
username: 'peertube'
|
username: 'peertube'
|
||||||
password: 'peertube'
|
password: 'peertube'
|
||||||
|
pool:
|
||||||
|
max: 5
|
||||||
|
|
||||||
# Redis server for short time storage
|
# Redis server for short time storage
|
||||||
# You can also specify a 'socket' path to a unix socket but first need to
|
# You can also specify a 'socket' path to a unix socket but first need to
|
||||||
|
|
|
@ -43,7 +43,7 @@ function checkMissedConfig () {
|
||||||
const required = [ 'listen.port', 'listen.hostname',
|
const required = [ 'listen.port', 'listen.hostname',
|
||||||
'webserver.https', 'webserver.hostname', 'webserver.port',
|
'webserver.https', 'webserver.hostname', 'webserver.port',
|
||||||
'trust_proxy',
|
'trust_proxy',
|
||||||
'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password',
|
'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password', 'database.pool.max',
|
||||||
'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address',
|
'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address',
|
||||||
'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache',
|
'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache',
|
||||||
'log.level',
|
'log.level',
|
||||||
|
|
|
@ -121,7 +121,10 @@ const CONFIG = {
|
||||||
HOSTNAME: config.get<string>('database.hostname'),
|
HOSTNAME: config.get<string>('database.hostname'),
|
||||||
PORT: config.get<number>('database.port'),
|
PORT: config.get<number>('database.port'),
|
||||||
USERNAME: config.get<string>('database.username'),
|
USERNAME: config.get<string>('database.username'),
|
||||||
PASSWORD: config.get<string>('database.password')
|
PASSWORD: config.get<string>('database.password'),
|
||||||
|
POOL: {
|
||||||
|
MAX: config.get<number>('database.pool.max')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
REDIS: {
|
REDIS: {
|
||||||
HOSTNAME: config.has('redis.hostname') ? config.get<string>('redis.hostname') : null,
|
HOSTNAME: config.has('redis.hostname') ? config.get<string>('redis.hostname') : null,
|
||||||
|
|
|
@ -32,6 +32,7 @@ const username = CONFIG.DATABASE.USERNAME
|
||||||
const password = CONFIG.DATABASE.PASSWORD
|
const password = CONFIG.DATABASE.PASSWORD
|
||||||
const host = CONFIG.DATABASE.HOSTNAME
|
const host = CONFIG.DATABASE.HOSTNAME
|
||||||
const port = CONFIG.DATABASE.PORT
|
const port = CONFIG.DATABASE.PORT
|
||||||
|
const poolMax = CONFIG.DATABASE.POOL.MAX
|
||||||
|
|
||||||
const sequelizeTypescript = new SequelizeTypescript({
|
const sequelizeTypescript = new SequelizeTypescript({
|
||||||
database: dbname,
|
database: dbname,
|
||||||
|
@ -40,6 +41,9 @@ const sequelizeTypescript = new SequelizeTypescript({
|
||||||
port,
|
port,
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
|
pool: {
|
||||||
|
max: poolMax
|
||||||
|
},
|
||||||
benchmark: isTestInstance(),
|
benchmark: isTestInstance(),
|
||||||
isolationLevel: SequelizeTypescript.Transaction.ISOLATION_LEVELS.SERIALIZABLE,
|
isolationLevel: SequelizeTypescript.Transaction.ISOLATION_LEVELS.SERIALIZABLE,
|
||||||
operatorsAliases: false,
|
operatorsAliases: false,
|
||||||
|
|
Loading…
Reference in New Issue