diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-14 18:06:56 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-14 18:06:56 +0200 |
commit | 2baea0c77cc765f7cbca9c9a2f4272268892a35c (patch) | |
tree | 47b1be5535439409a97eb80c0222c9c821b83dae /server/initializers/constants.ts | |
parent | bf079b7bfd7f0fb75ceb28e333bb4b74d8840dd4 (diff) | |
download | PeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.tar.gz PeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.tar.zst PeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.zip |
Add ability for uploaders to schedule video update
Diffstat (limited to 'server/initializers/constants.ts')
-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 65f89ff7f..164378505 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -8,6 +8,8 @@ import { VideoPrivacy } from '../../shared/models/videos' | |||
8 | import { buildPath, isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' | 8 | import { buildPath, isTestInstance, 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 { RemoveOldJobsScheduler } from '../lib/schedulers/remove-old-jobs-scheduler' | ||
12 | import { 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 |
13 | let config: IConfig = require('config') | 15 | let config: IConfig = require('config') |
@@ -94,7 +96,11 @@ const JOB_REQUEST_TTL = 60000 * 10 // 10 minutes | |||
94 | const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days | 96 | const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days |
95 | 97 | ||
96 | // 1 hour | 98 | // 1 hour |
97 | let SCHEDULER_INTERVAL = 60000 * 60 | 99 | let 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, |