diff options
Diffstat (limited to 'server/initializers/database.ts')
-rw-r--r-- | server/initializers/database.ts | 8 |
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' | |||
8 | import { UserVideoHistoryModel } from '@server/models/user/user-video-history' | 8 | import { UserVideoHistoryModel } from '@server/models/user/user-video-history' |
9 | import { VideoJobInfoModel } from '@server/models/video/video-job-info' | 9 | import { VideoJobInfoModel } from '@server/models/video/video-job-info' |
10 | import { VideoLiveSessionModel } from '@server/models/video/video-live-session' | 10 | import { VideoLiveSessionModel } from '@server/models/video/video-live-session' |
11 | import { VideoSourceModel } from '@server/models/video/video-source' | ||
11 | import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer' | 12 | import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer' |
12 | import { LocalVideoViewerWatchSectionModel } from '@server/models/view/local-video-viewer-watch-section' | 13 | import { LocalVideoViewerWatchSectionModel } from '@server/models/view/local-video-viewer-watch-section' |
13 | import { isTestInstance } from '../helpers/core-utils' | 14 | import { isTestOrDevInstance } from '../helpers/core-utils' |
14 | import { logger } from '../helpers/logger' | 15 | import { logger } from '../helpers/logger' |
15 | import { AbuseModel } from '../models/abuse/abuse' | 16 | import { AbuseModel } from '../models/abuse/abuse' |
16 | import { AbuseMessageModel } from '../models/abuse/abuse-message' | 17 | import { AbuseMessageModel } from '../models/abuse/abuse-message' |
@@ -49,7 +50,6 @@ import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-pla | |||
49 | import { VideoTagModel } from '../models/video/video-tag' | 50 | import { VideoTagModel } from '../models/video/video-tag' |
50 | import { VideoViewModel } from '../models/view/video-view' | 51 | import { VideoViewModel } from '../models/view/video-view' |
51 | import { CONFIG } from './config' | 52 | import { CONFIG } from './config' |
52 | import { VideoSourceModel } from '@server/models/video/video-source' | ||
53 | 53 | ||
54 | require('pg').defaults.parseInt8 = true // Avoid BIGINT to be converted to string | 54 | require('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 | ||