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.ts22
1 files changed, 20 insertions, 2 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 991fe3e85..c8fa8fa2c 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -239,7 +239,23 @@ const REQUEST_TIMEOUTS = {
239 REDUNDANCY: JOB_TTL['video-redundancy'] 239 REDUNDANCY: JOB_TTL['video-redundancy']
240} 240}
241 241
242const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days 242const JOB_REMOVAL_OPTIONS = {
243 COUNT: 10000, // Max jobs to store
244
245 SUCCESS: { // Success jobs
246 'DEFAULT': parseDurationToMs('2 days'),
247
248 'activitypub-http-broadcast-parallel': parseDurationToMs('10 minutes'),
249 'activitypub-http-unicast': parseDurationToMs('1 hour'),
250 'videos-views-stats': parseDurationToMs('3 hours'),
251 'activitypub-refresher': parseDurationToMs('10 hours')
252 },
253
254 FAILURE: { // Failed job
255 DEFAULT: parseDurationToMs('7 days')
256 }
257}
258
243const VIDEO_IMPORT_TIMEOUT = Math.floor(JOB_TTL['video-import'] * 0.9) 259const VIDEO_IMPORT_TIMEOUT = Math.floor(JOB_TTL['video-import'] * 0.9)
244 260
245const SCHEDULER_INTERVALS_MS = { 261const SCHEDULER_INTERVALS_MS = {
@@ -938,6 +954,8 @@ if (process.env.PRODUCTION_CONSTANTS !== 'true') {
938 OVERVIEWS.VIDEOS.SAMPLE_THRESHOLD = 2 954 OVERVIEWS.VIDEOS.SAMPLE_THRESHOLD = 2
939 955
940 PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME = 5000 956 PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME = 5000
957
958 JOB_REMOVAL_OPTIONS.SUCCESS['videos-views-stats'] = 10000
941 } 959 }
942 960
943 if (isTestInstance()) { 961 if (isTestInstance()) {
@@ -1069,7 +1087,7 @@ export {
1069 CRAWL_REQUEST_CONCURRENCY, 1087 CRAWL_REQUEST_CONCURRENCY,
1070 DEFAULT_AUDIO_RESOLUTION, 1088 DEFAULT_AUDIO_RESOLUTION,
1071 BINARY_CONTENT_TYPES, 1089 BINARY_CONTENT_TYPES,
1072 JOB_COMPLETED_LIFETIME, 1090 JOB_REMOVAL_OPTIONS,
1073 HTTP_SIGNATURE, 1091 HTTP_SIGNATURE,
1074 VIDEO_IMPORT_STATES, 1092 VIDEO_IMPORT_STATES,
1075 VIDEO_CHANNEL_SYNC_STATE, 1093 VIDEO_CHANNEL_SYNC_STATE,