diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-24 13:07:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-24 13:38:39 +0200 |
commit | e5565833f62b97f62ea75eba5b479963ae78b873 (patch) | |
tree | 835793ce464f9666b0ceae79f3d278cc4e007b32 /server/initializers/constants.ts | |
parent | d1a63fc7ac58a1db00d8ca4f43aadba02eb9b084 (diff) | |
download | PeerTube-e5565833f62b97f62ea75eba5b479963ae78b873.tar.gz PeerTube-e5565833f62b97f62ea75eba5b479963ae78b873.tar.zst PeerTube-e5565833f62b97f62ea75eba5b479963ae78b873.zip |
Improve redundancy: add 'min_lifetime' configuration
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 03424ffb8..947cbda28 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -601,7 +601,6 @@ const MEMOIZE_TTL = { | |||
601 | 601 | ||
602 | const REDUNDANCY = { | 602 | const REDUNDANCY = { |
603 | VIDEOS: { | 603 | VIDEOS: { |
604 | EXPIRES_AFTER_MS: 48 * 3600 * 1000, // 2 days | ||
605 | RANDOMIZED_FACTOR: 5 | 604 | RANDOMIZED_FACTOR: 5 |
606 | } | 605 | } |
607 | } | 606 | } |
@@ -750,10 +749,16 @@ function updateWebserverConfig () { | |||
750 | CONFIG.WEBSERVER.HOST = sanitizeHost(CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT, REMOTE_SCHEME.HTTP) | 749 | CONFIG.WEBSERVER.HOST = sanitizeHost(CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT, REMOTE_SCHEME.HTTP) |
751 | } | 750 | } |
752 | 751 | ||
753 | function buildVideosRedundancy (objs: VideosRedundancy[]): VideosRedundancy[] { | 752 | function buildVideosRedundancy (objs: any[]): VideosRedundancy[] { |
754 | if (!objs) return [] | 753 | if (!objs) return [] |
755 | 754 | ||
756 | return objs.map(obj => Object.assign(obj, { size: bytes.parse(obj.size) })) | 755 | return objs.map(obj => { |
756 | return Object.assign(obj, { | ||
757 | minLifetime: parseDuration(obj.min_lifetime), | ||
758 | size: bytes.parse(obj.size), | ||
759 | minViews: obj.min_views | ||
760 | }) | ||
761 | }) | ||
757 | } | 762 | } |
758 | 763 | ||
759 | function buildLanguages () { | 764 | function buildLanguages () { |