aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/database.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/database.ts')
-rw-r--r--server/initializers/database.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/initializers/database.ts b/server/initializers/database.ts
index 09786a91f..91286241b 100644
--- a/server/initializers/database.ts
+++ b/server/initializers/database.ts
@@ -8,9 +8,10 @@ import { UserNotificationModel } from '@server/models/user/user-notification'
8import { UserVideoHistoryModel } from '@server/models/user/user-video-history' 8import { UserVideoHistoryModel } from '@server/models/user/user-video-history'
9import { VideoJobInfoModel } from '@server/models/video/video-job-info' 9import { VideoJobInfoModel } from '@server/models/video/video-job-info'
10import { VideoLiveSessionModel } from '@server/models/video/video-live-session' 10import { VideoLiveSessionModel } from '@server/models/video/video-live-session'
11import { VideoSourceModel } from '@server/models/video/video-source'
11import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer' 12import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer'
12import { LocalVideoViewerWatchSectionModel } from '@server/models/view/local-video-viewer-watch-section' 13import { LocalVideoViewerWatchSectionModel } from '@server/models/view/local-video-viewer-watch-section'
13import { isTestInstance } from '../helpers/core-utils' 14import { isTestOrDevInstance } from '../helpers/core-utils'
14import { logger } from '../helpers/logger' 15import { logger } from '../helpers/logger'
15import { AbuseModel } from '../models/abuse/abuse' 16import { AbuseModel } from '../models/abuse/abuse'
16import { AbuseMessageModel } from '../models/abuse/abuse-message' 17import { AbuseMessageModel } from '../models/abuse/abuse-message'
@@ -49,7 +50,6 @@ import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-pla
49import { VideoTagModel } from '../models/video/video-tag' 50import { VideoTagModel } from '../models/video/video-tag'
50import { VideoViewModel } from '../models/view/video-view' 51import { VideoViewModel } from '../models/view/video-view'
51import { CONFIG } from './config' 52import { CONFIG } from './config'
52import { VideoSourceModel } from '@server/models/video/video-source'
53 53
54require('pg').defaults.parseInt8 = true // Avoid BIGINT to be converted to string 54require('pg').defaults.parseInt8 = true // Avoid BIGINT to be converted to string
55 55
@@ -81,13 +81,13 @@ const sequelizeTypescript = new SequelizeTypescript({
81 pool: { 81 pool: {
82 max: poolMax 82 max: poolMax
83 }, 83 },
84 benchmark: isTestInstance(), 84 benchmark: isTestOrDevInstance(),
85 isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE, 85 isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE,
86 logging: (message: string, benchmark: number) => { 86 logging: (message: string, benchmark: number) => {
87 if (process.env.NODE_DB_LOG === 'false') return 87 if (process.env.NODE_DB_LOG === 'false') return
88 88
89 let newMessage = 'Executed SQL request' 89 let newMessage = 'Executed SQL request'
90 if (isTestInstance() === true && benchmark !== undefined) { 90 if (isTestOrDevInstance() === true && benchmark !== undefined) {
91 newMessage += ' in ' + benchmark + 'ms' 91 newMessage += ' in ' + benchmark + 'ms'
92 } 92 }
93 93