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.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 7816561fd..c899812a6 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -19,7 +19,7 @@ import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
19import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model' 19import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model'
20import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model' 20import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model'
21// Do not use barrels, remain constants as independent as possible 21// Do not use barrels, remain constants as independent as possible
22import { isTestInstance, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' 22import { isTestInstance, parseDurationToMs, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
23import { CONFIG, registerConfigChangedHandler } from './config' 23import { CONFIG, registerConfigChangedHandler } from './config'
24 24
25// --------------------------------------------------------------------------- 25// ---------------------------------------------------------------------------
@@ -200,8 +200,14 @@ const JOB_PRIORITY = {
200} 200}
201 201
202const BROADCAST_CONCURRENCY = 30 // How many requests in parallel we do in activitypub-http-broadcast job 202const BROADCAST_CONCURRENCY = 30 // How many requests in parallel we do in activitypub-http-broadcast job
203const AP_CLEANER_CONCURRENCY = 10 // How many requests in parallel we do in activitypub-cleaner job
204const CRAWL_REQUEST_CONCURRENCY = 1 // How many requests in parallel to fetch remote data (likes, shares...) 203const CRAWL_REQUEST_CONCURRENCY = 1 // How many requests in parallel to fetch remote data (likes, shares...)
204
205const AP_CLEANER = {
206 CONCURRENCY: 10, // How many requests in parallel we do in activitypub-cleaner job
207 UNAVAILABLE_TRESHOLD: 3, // How many attemps we do before removing an unavailable remote resource
208 PERIOD: parseDurationToMs('1 week') // /!\ Has to be sync with REPEAT_JOBS
209}
210
205const REQUEST_TIMEOUTS = { 211const REQUEST_TIMEOUTS = {
206 DEFAULT: 7000, // 7 seconds 212 DEFAULT: 7000, // 7 seconds
207 FILE: 30000, // 30 seconds 213 FILE: 30000, // 30 seconds
@@ -796,8 +802,11 @@ if (isTestInstance() === true) {
796 SCHEDULER_INTERVALS_MS.AUTO_FOLLOW_INDEX_INSTANCES = 5000 802 SCHEDULER_INTERVALS_MS.AUTO_FOLLOW_INDEX_INSTANCES = 5000
797 SCHEDULER_INTERVALS_MS.UPDATE_INBOX_STATS = 5000 803 SCHEDULER_INTERVALS_MS.UPDATE_INBOX_STATS = 5000
798 SCHEDULER_INTERVALS_MS.CHECK_PEERTUBE_VERSION = 2000 804 SCHEDULER_INTERVALS_MS.CHECK_PEERTUBE_VERSION = 2000
805
799 REPEAT_JOBS['videos-views-stats'] = { every: 5000 } 806 REPEAT_JOBS['videos-views-stats'] = { every: 5000 }
807
800 REPEAT_JOBS['activitypub-cleaner'] = { every: 5000 } 808 REPEAT_JOBS['activitypub-cleaner'] = { every: 5000 }
809 AP_CLEANER.PERIOD = 5000
801 810
802 REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1 811 REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1
803 812
@@ -858,7 +867,7 @@ export {
858 REDUNDANCY, 867 REDUNDANCY,
859 JOB_CONCURRENCY, 868 JOB_CONCURRENCY,
860 JOB_ATTEMPTS, 869 JOB_ATTEMPTS,
861 AP_CLEANER_CONCURRENCY, 870 AP_CLEANER,
862 LAST_MIGRATION_VERSION, 871 LAST_MIGRATION_VERSION,
863 OAUTH_LIFETIME, 872 OAUTH_LIFETIME,
864 CUSTOM_HTML_TAG_COMMENTS, 873 CUSTOM_HTML_TAG_COMMENTS,