diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-28 11:36:51 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-28 11:37:05 +0100 |
commit | f1569117f9bc468bc38b5b8d32df1bce40cc42ad (patch) | |
tree | caff10eff498b18c0207b2f9bea122fdead34e00 /server/initializers | |
parent | 21d68e68039a1eefbe6213fbde46e737e520ee7d (diff) | |
download | PeerTube-f1569117f9bc468bc38b5b8d32df1bce40cc42ad.tar.gz PeerTube-f1569117f9bc468bc38b5b8d32df1bce40cc42ad.tar.zst PeerTube-f1569117f9bc468bc38b5b8d32df1bce40cc42ad.zip |
Cleanup unavailable remote AP resource
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.ts | 15 |
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' | |||
19 | import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model' | 19 | import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model' |
20 | import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model' | 20 | import { 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 |
22 | import { isTestInstance, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' | 22 | import { isTestInstance, parseDurationToMs, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' |
23 | import { CONFIG, registerConfigChangedHandler } from './config' | 23 | import { CONFIG, registerConfigChangedHandler } from './config' |
24 | 24 | ||
25 | // --------------------------------------------------------------------------- | 25 | // --------------------------------------------------------------------------- |
@@ -200,8 +200,14 @@ const JOB_PRIORITY = { | |||
200 | } | 200 | } |
201 | 201 | ||
202 | const BROADCAST_CONCURRENCY = 30 // How many requests in parallel we do in activitypub-http-broadcast job | 202 | const BROADCAST_CONCURRENCY = 30 // How many requests in parallel we do in activitypub-http-broadcast job |
203 | const AP_CLEANER_CONCURRENCY = 10 // How many requests in parallel we do in activitypub-cleaner job | ||
204 | const CRAWL_REQUEST_CONCURRENCY = 1 // How many requests in parallel to fetch remote data (likes, shares...) | 203 | const CRAWL_REQUEST_CONCURRENCY = 1 // How many requests in parallel to fetch remote data (likes, shares...) |
204 | |||
205 | const 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 | |||
205 | const REQUEST_TIMEOUTS = { | 211 | const 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, |