diff options
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 5a5f2d666..697a64d42 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -6,6 +6,7 @@ import { randomInt, root } from '@shared/core-utils' | |||
6 | import { | 6 | import { |
7 | AbuseState, | 7 | AbuseState, |
8 | JobType, | 8 | JobType, |
9 | VideoChannelSyncState, | ||
9 | VideoImportState, | 10 | VideoImportState, |
10 | VideoPrivacy, | 11 | VideoPrivacy, |
11 | VideoRateType, | 12 | VideoRateType, |
@@ -24,7 +25,7 @@ import { CONFIG, registerConfigChangedHandler } from './config' | |||
24 | 25 | ||
25 | // --------------------------------------------------------------------------- | 26 | // --------------------------------------------------------------------------- |
26 | 27 | ||
27 | const LAST_MIGRATION_VERSION = 725 | 28 | const LAST_MIGRATION_VERSION = 730 |
28 | 29 | ||
29 | // --------------------------------------------------------------------------- | 30 | // --------------------------------------------------------------------------- |
30 | 31 | ||
@@ -64,6 +65,7 @@ const SORTABLE_COLUMNS = { | |||
64 | JOBS: [ 'createdAt' ], | 65 | JOBS: [ 'createdAt' ], |
65 | VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ], | 66 | VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ], |
66 | VIDEO_IMPORTS: [ 'createdAt' ], | 67 | VIDEO_IMPORTS: [ 'createdAt' ], |
68 | VIDEO_CHANNEL_SYNCS: [ 'externalChannelUrl', 'videoChannel', 'createdAt', 'lastSyncAt', 'state' ], | ||
67 | 69 | ||
68 | VIDEO_COMMENT_THREADS: [ 'createdAt', 'totalReplies' ], | 70 | VIDEO_COMMENT_THREADS: [ 'createdAt', 'totalReplies' ], |
69 | VIDEO_COMMENTS: [ 'createdAt' ], | 71 | VIDEO_COMMENTS: [ 'createdAt' ], |
@@ -156,6 +158,8 @@ const JOB_ATTEMPTS: { [id in JobType]: number } = { | |||
156 | 'video-live-ending': 1, | 158 | 'video-live-ending': 1, |
157 | 'video-studio-edition': 1, | 159 | 'video-studio-edition': 1, |
158 | 'manage-video-torrent': 1, | 160 | 'manage-video-torrent': 1, |
161 | 'video-channel-import': 1, | ||
162 | 'after-video-channel-import': 1, | ||
159 | 'move-to-object-storage': 3, | 163 | 'move-to-object-storage': 3, |
160 | 'notify': 1, | 164 | 'notify': 1, |
161 | 'federate-video': 1 | 165 | 'federate-video': 1 |
@@ -178,6 +182,8 @@ const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-im | |||
178 | 'video-studio-edition': 1, | 182 | 'video-studio-edition': 1, |
179 | 'manage-video-torrent': 1, | 183 | 'manage-video-torrent': 1, |
180 | 'move-to-object-storage': 1, | 184 | 'move-to-object-storage': 1, |
185 | 'video-channel-import': 1, | ||
186 | 'after-video-channel-import': 1, | ||
181 | 'notify': 5, | 187 | 'notify': 5, |
182 | 'federate-video': 3 | 188 | 'federate-video': 3 |
183 | } | 189 | } |
@@ -199,9 +205,11 @@ const JOB_TTL: { [id in JobType]: number } = { | |||
199 | 'video-redundancy': 1000 * 3600 * 3, // 3 hours | 205 | 'video-redundancy': 1000 * 3600 * 3, // 3 hours |
200 | 'video-live-ending': 1000 * 60 * 10, // 10 minutes | 206 | 'video-live-ending': 1000 * 60 * 10, // 10 minutes |
201 | 'manage-video-torrent': 1000 * 3600 * 3, // 3 hours | 207 | 'manage-video-torrent': 1000 * 3600 * 3, // 3 hours |
208 | 'move-to-object-storage': 1000 * 60 * 60 * 3, // 3 hours | ||
209 | 'video-channel-import': 1000 * 60 * 60 * 4, // 4 hours | ||
210 | 'after-video-channel-import': 60000 * 5, // 5 minutes | ||
202 | 'notify': 60000 * 5, // 5 minutes | 211 | 'notify': 60000 * 5, // 5 minutes |
203 | 'federate-video': 60000 * 5, // 5 minutes | 212 | 'federate-video': 60000 * 5 // 5 minutes |
204 | 'move-to-object-storage': 1000 * 60 * 60 * 3 // 3 hours | ||
205 | } | 213 | } |
206 | const REPEAT_JOBS: { [ id in JobType ]?: RepeatOptions } = { | 214 | const REPEAT_JOBS: { [ id in JobType ]?: RepeatOptions } = { |
207 | 'videos-views-stats': { | 215 | 'videos-views-stats': { |
@@ -246,7 +254,8 @@ const SCHEDULER_INTERVALS_MS = { | |||
246 | REMOVE_OLD_VIEWS: 60000 * 60 * 24, // 1 day | 254 | REMOVE_OLD_VIEWS: 60000 * 60 * 24, // 1 day |
247 | REMOVE_OLD_HISTORY: 60000 * 60 * 24, // 1 day | 255 | REMOVE_OLD_HISTORY: 60000 * 60 * 24, // 1 day |
248 | UPDATE_INBOX_STATS: 1000 * 60, // 1 minute | 256 | UPDATE_INBOX_STATS: 1000 * 60, // 1 minute |
249 | REMOVE_DANGLING_RESUMABLE_UPLOADS: 60000 * 60 // 1 hour | 257 | REMOVE_DANGLING_RESUMABLE_UPLOADS: 60000 * 60, // 1 hour |
258 | CHANNEL_SYNC_CHECK_INTERVAL: CONFIG.IMPORT.VIDEO_CHANNEL_SYNCHRONIZATION.CHECK_INTERVAL | ||
250 | } | 259 | } |
251 | 260 | ||
252 | // --------------------------------------------------------------------------- | 261 | // --------------------------------------------------------------------------- |
@@ -276,8 +285,12 @@ const CONSTRAINTS_FIELDS = { | |||
276 | NAME: { min: 1, max: 120 }, // Length | 285 | NAME: { min: 1, max: 120 }, // Length |
277 | DESCRIPTION: { min: 3, max: 1000 }, // Length | 286 | DESCRIPTION: { min: 3, max: 1000 }, // Length |
278 | SUPPORT: { min: 3, max: 1000 }, // Length | 287 | SUPPORT: { min: 3, max: 1000 }, // Length |
288 | EXTERNAL_CHANNEL_URL: { min: 3, max: 2000 }, // Length | ||
279 | URL: { min: 3, max: 2000 } // Length | 289 | URL: { min: 3, max: 2000 } // Length |
280 | }, | 290 | }, |
291 | VIDEO_CHANNEL_SYNCS: { | ||
292 | EXTERNAL_CHANNEL_URL: { min: 3, max: 2000 } // Length | ||
293 | }, | ||
281 | VIDEO_CAPTIONS: { | 294 | VIDEO_CAPTIONS: { |
282 | CAPTION_FILE: { | 295 | CAPTION_FILE: { |
283 | EXTNAME: [ '.vtt', '.srt' ], | 296 | EXTNAME: [ '.vtt', '.srt' ], |
@@ -478,6 +491,13 @@ const VIDEO_IMPORT_STATES: { [ id in VideoImportState ]: string } = { | |||
478 | [VideoImportState.PROCESSING]: 'Processing' | 491 | [VideoImportState.PROCESSING]: 'Processing' |
479 | } | 492 | } |
480 | 493 | ||
494 | const VIDEO_CHANNEL_SYNC_STATE: { [ id in VideoChannelSyncState ]: string } = { | ||
495 | [VideoChannelSyncState.FAILED]: 'Failed', | ||
496 | [VideoChannelSyncState.SYNCED]: 'Synchronized', | ||
497 | [VideoChannelSyncState.PROCESSING]: 'Processing', | ||
498 | [VideoChannelSyncState.WAITING_FIRST_RUN]: 'Waiting first run' | ||
499 | } | ||
500 | |||
481 | const ABUSE_STATES: { [ id in AbuseState ]: string } = { | 501 | const ABUSE_STATES: { [ id in AbuseState ]: string } = { |
482 | [AbuseState.PENDING]: 'Pending', | 502 | [AbuseState.PENDING]: 'Pending', |
483 | [AbuseState.REJECTED]: 'Rejected', | 503 | [AbuseState.REJECTED]: 'Rejected', |
@@ -1005,6 +1025,7 @@ export { | |||
1005 | JOB_COMPLETED_LIFETIME, | 1025 | JOB_COMPLETED_LIFETIME, |
1006 | HTTP_SIGNATURE, | 1026 | HTTP_SIGNATURE, |
1007 | VIDEO_IMPORT_STATES, | 1027 | VIDEO_IMPORT_STATES, |
1028 | VIDEO_CHANNEL_SYNC_STATE, | ||
1008 | VIEW_LIFETIME, | 1029 | VIEW_LIFETIME, |
1009 | CONTACT_FORM_LIFETIME, | 1030 | CONTACT_FORM_LIFETIME, |
1010 | VIDEO_PLAYLIST_PRIVACIES, | 1031 | VIDEO_PLAYLIST_PRIVACIES, |