diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-19 16:21:09 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-19 16:21:30 +0200 |
commit | f9f899b9f803eb5159a67781f10649a0cf040677 (patch) | |
tree | 2c02f33e38b0fdc9401fe5c98d7b148c967c68df /server/initializers/constants.ts | |
parent | d9bdd007d7a1368d2a13127ecb5c0a81a18a8c04 (diff) | |
download | PeerTube-f9f899b9f803eb5159a67781f10649a0cf040677.tar.gz PeerTube-f9f899b9f803eb5159a67781f10649a0cf040677.tar.zst PeerTube-f9f899b9f803eb5159a67781f10649a0cf040677.zip |
Add redundancy check interval in config
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 7 |
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' | |||
5 | import { FollowState } from '../../shared/models/actors' | 5 | import { FollowState } from '../../shared/models/actors' |
6 | import { VideoAbuseState, VideoImportState, VideoPrivacy } from '../../shared/models/videos' | 6 | import { 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 |
8 | import { buildPath, isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' | 8 | import { buildPath, isTestInstance, parseDuration, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' |
9 | import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' | 9 | import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' |
10 | import { invert } from 'lodash' | 10 | import { invert } from 'lodash' |
11 | import { CronRepeatOptions, EveryRepeatOptions } from 'bull' | 11 | import { 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 |