aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 881978753..03424ffb8 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -5,7 +5,7 @@ import { ActivityPubActorType } from '../../shared/models/activitypub'
5import { FollowState } from '../../shared/models/actors' 5import { FollowState } from '../../shared/models/actors'
6import { VideoAbuseState, VideoImportState, VideoPrivacy } from '../../shared/models/videos' 6import { VideoAbuseState, VideoImportState, VideoPrivacy } from '../../shared/models/videos'
7// Do not use barrels, remain constants as independent as possible 7// Do not use barrels, remain constants as independent as possible
8import { buildPath, isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' 8import { buildPath, isTestInstance, parseDuration, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
9import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' 9import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
10import { invert } from 'lodash' 10import { invert } from 'lodash'
11import { CronRepeatOptions, EveryRepeatOptions } from 'bull' 11import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
@@ -139,8 +139,7 @@ let SCHEDULER_INTERVALS_MS = {
139 badActorFollow: 60000 * 60, // 1 hour 139 badActorFollow: 60000 * 60, // 1 hour
140 removeOldJobs: 60000 * 60, // 1 hour 140 removeOldJobs: 60000 * 60, // 1 hour
141 updateVideos: 60000, // 1 minute 141 updateVideos: 60000, // 1 minute
142 youtubeDLUpdate: 60000 * 60 * 24, // 1 day 142 youtubeDLUpdate: 60000 * 60 * 24 // 1 day
143 videosRedundancy: 60000 * 2 // 2 hours
144} 143}
145 144
146// --------------------------------------------------------------------------- 145// ---------------------------------------------------------------------------
@@ -213,6 +212,7 @@ const CONFIG = {
213 }, 212 },
214 REDUNDANCY: { 213 REDUNDANCY: {
215 VIDEOS: { 214 VIDEOS: {
215 CHECK_INTERVAL: parseDuration(config.get<string>('redundancy.videos.check_interval')),
216 STRATEGIES: buildVideosRedundancy(config.get<any[]>('redundancy.videos.strategies')) 216 STRATEGIES: buildVideosRedundancy(config.get<any[]>('redundancy.videos.strategies'))
217 } 217 }
218 }, 218 },
@@ -651,7 +651,6 @@ if (isTestInstance() === true) {
651 SCHEDULER_INTERVALS_MS.badActorFollow = 10000 651 SCHEDULER_INTERVALS_MS.badActorFollow = 10000
652 SCHEDULER_INTERVALS_MS.removeOldJobs = 10000 652 SCHEDULER_INTERVALS_MS.removeOldJobs = 10000
653 SCHEDULER_INTERVALS_MS.updateVideos = 5000 653 SCHEDULER_INTERVALS_MS.updateVideos = 5000
654 SCHEDULER_INTERVALS_MS.videosRedundancy = 5000
655 REPEAT_JOBS['videos-views'] = { every: 5000 } 654 REPEAT_JOBS['videos-views'] = { every: 5000 }
656 655
657 REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1 656 REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1