diff options
Diffstat (limited to 'server/initializers/database.ts')
-rw-r--r-- | server/initializers/database.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/initializers/database.ts b/server/initializers/database.ts index 1a9ce5a61..0be752363 100644 --- a/server/initializers/database.ts +++ b/server/initializers/database.ts | |||
@@ -24,6 +24,7 @@ import { VideoTagModel } from '../models/video/video-tag' | |||
24 | import { CONFIG } from './constants' | 24 | import { CONFIG } from './constants' |
25 | import { ScheduleVideoUpdateModel } from '../models/video/schedule-video-update' | 25 | import { ScheduleVideoUpdateModel } from '../models/video/schedule-video-update' |
26 | import { VideoCaptionModel } from '../models/video/video-caption' | 26 | import { VideoCaptionModel } from '../models/video/video-caption' |
27 | import { VideoImportModel } from '../models/video/video-import' | ||
27 | 28 | ||
28 | require('pg').defaults.parseInt8 = true // Avoid BIGINT to be converted to string | 29 | require('pg').defaults.parseInt8 = true // Avoid BIGINT to be converted to string |
29 | 30 | ||
@@ -32,6 +33,7 @@ const username = CONFIG.DATABASE.USERNAME | |||
32 | const password = CONFIG.DATABASE.PASSWORD | 33 | const password = CONFIG.DATABASE.PASSWORD |
33 | const host = CONFIG.DATABASE.HOSTNAME | 34 | const host = CONFIG.DATABASE.HOSTNAME |
34 | const port = CONFIG.DATABASE.PORT | 35 | const port = CONFIG.DATABASE.PORT |
36 | const poolMax = CONFIG.DATABASE.POOL.MAX | ||
35 | 37 | ||
36 | const sequelizeTypescript = new SequelizeTypescript({ | 38 | const sequelizeTypescript = new SequelizeTypescript({ |
37 | database: dbname, | 39 | database: dbname, |
@@ -40,6 +42,9 @@ const sequelizeTypescript = new SequelizeTypescript({ | |||
40 | port, | 42 | port, |
41 | username, | 43 | username, |
42 | password, | 44 | password, |
45 | pool: { | ||
46 | max: poolMax | ||
47 | }, | ||
43 | benchmark: isTestInstance(), | 48 | benchmark: isTestInstance(), |
44 | isolationLevel: SequelizeTypescript.Transaction.ISOLATION_LEVELS.SERIALIZABLE, | 49 | isolationLevel: SequelizeTypescript.Transaction.ISOLATION_LEVELS.SERIALIZABLE, |
45 | operatorsAliases: false, | 50 | operatorsAliases: false, |
@@ -77,7 +82,8 @@ async function initDatabaseModels (silent: boolean) { | |||
77 | VideoTagModel, | 82 | VideoTagModel, |
78 | VideoModel, | 83 | VideoModel, |
79 | VideoCommentModel, | 84 | VideoCommentModel, |
80 | ScheduleVideoUpdateModel | 85 | ScheduleVideoUpdateModel, |
86 | VideoImportModel | ||
81 | ]) | 87 | ]) |
82 | 88 | ||
83 | // Check extensions exist in the database | 89 | // Check extensions exist in the database |