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 65f89ff7f..164378505 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -8,6 +8,8 @@ import { VideoPrivacy } from '../../shared/models/videos'
8import { buildPath, isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' 8import { buildPath, isTestInstance, 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 { RemoveOldJobsScheduler } from '../lib/schedulers/remove-old-jobs-scheduler'
12import { UpdateVideosScheduler } from '../lib/schedulers/update-videos-scheduler'
11 13
12// Use a variable to reload the configuration if we need 14// Use a variable to reload the configuration if we need
13let config: IConfig = require('config') 15let config: IConfig = require('config')
@@ -94,7 +96,11 @@ const JOB_REQUEST_TTL = 60000 * 10 // 10 minutes
94const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days 96const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days
95 97
96// 1 hour 98// 1 hour
97let SCHEDULER_INTERVAL = 60000 * 60 99let SCHEDULER_INTERVALS_MS = {
100 badActorFollow: 60000 * 60, // 1 hour
101 removeOldJobs: 60000 * 60, // 1 jour
102 updateVideos: 60000 * 1, // 1 minute
103}
98 104
99// --------------------------------------------------------------------------- 105// ---------------------------------------------------------------------------
100 106
@@ -460,7 +466,10 @@ if (isTestInstance() === true) {
460 466
461 CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max = 100 * 1024 // 100KB 467 CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max = 100 * 1024 // 100KB
462 468
463 SCHEDULER_INTERVAL = 10000 469 SCHEDULER_INTERVALS_MS.badActorFollow = 10000
470 SCHEDULER_INTERVALS_MS.removeOldJobs = 10000
471 SCHEDULER_INTERVALS_MS.updateVideos = 5000
472
464 VIDEO_VIEW_LIFETIME = 1000 // 1 second 473 VIDEO_VIEW_LIFETIME = 1000 // 1 second
465 474
466 JOB_ATTEMPTS['email'] = 1 475 JOB_ATTEMPTS['email'] = 1
@@ -513,7 +522,7 @@ export {
513 JOB_REQUEST_TTL, 522 JOB_REQUEST_TTL,
514 USER_PASSWORD_RESET_LIFETIME, 523 USER_PASSWORD_RESET_LIFETIME,
515 IMAGE_MIMETYPE_EXT, 524 IMAGE_MIMETYPE_EXT,
516 SCHEDULER_INTERVAL, 525 SCHEDULER_INTERVALS_MS,
517 STATIC_DOWNLOAD_PATHS, 526 STATIC_DOWNLOAD_PATHS,
518 RATES_LIMIT, 527 RATES_LIMIT,
519 VIDEO_EXT_MIMETYPE, 528 VIDEO_EXT_MIMETYPE,