X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fconstants.ts;h=de426c16e0ad35d731d8ac8d7f3c3945d2e17f1c;hb=39ba2e8e3a71961cd0087c57d25905f6a97a6b69;hp=03424ffb8f4d2ffc4f9adea006d728c14673c33f;hpb=0491173a61aed66205c017e0d7e0503ea316c144;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 03424ffb8..de426c16e 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -119,7 +119,7 @@ const JOB_TTL: { [ id in JobType ]: number } = { 'activitypub-follow': 60000 * 10, // 10 minutes 'video-file-import': 1000 * 3600, // 1 hour 'video-file': 1000 * 3600 * 48, // 2 days, transcoding could be long - 'video-import': 1000 * 3600 * 5, // 5 hours + 'video-import': 1000 * 3600, // 1 hour 'email': 60000 * 10, // 10 minutes 'videos-views': undefined // Unlimited } @@ -601,7 +601,6 @@ const MEMOIZE_TTL = { const REDUNDANCY = { VIDEOS: { - EXPIRES_AFTER_MS: 48 * 3600 * 1000, // 2 days RANDOMIZED_FACTOR: 5 } } @@ -750,10 +749,16 @@ function updateWebserverConfig () { CONFIG.WEBSERVER.HOST = sanitizeHost(CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT, REMOTE_SCHEME.HTTP) } -function buildVideosRedundancy (objs: VideosRedundancy[]): VideosRedundancy[] { +function buildVideosRedundancy (objs: any[]): VideosRedundancy[] { if (!objs) return [] - return objs.map(obj => Object.assign(obj, { size: bytes.parse(obj.size) })) + return objs.map(obj => { + return Object.assign(obj, { + minLifetime: parseDuration(obj.min_lifetime), + size: bytes.parse(obj.size), + minViews: obj.min_views + }) + }) } function buildLanguages () {