From 77d7e851dccf17dcc89e8fcc2db3f655d1e63f95 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Jan 2021 16:57:21 +0100 Subject: Add priority to transcoding jobs (1 = highest priority) 100 for new resolutions 10 for original file optimization Add a malus for transcoding jobs depending on how many uploads the user did in the last 7 days --- server/initializers/constants.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server/initializers') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 182bdf9cc..453ca02ed 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -179,6 +179,12 @@ const REPEAT_JOBS: { [ id: string ]: EveryRepeatOptions | CronRepeatOptions } = cron: randomInt(1, 20) + ' * * * *' // Between 1-20 minutes past the hour } } +const JOB_PRIORITY = { + TRANSCODING: { + OPTIMIZER: 10, + NEW_RESOLUTION: 100 + } +} const BROADCAST_CONCURRENCY = 10 // How many requests in parallel we do in activitypub-http-broadcast job const CRAWL_REQUEST_CONCURRENCY = 1 // How many requests in parallel to fetch remote data (likes, shares...) @@ -851,6 +857,7 @@ export { VIDEO_STATES, QUEUE_CONCURRENCY, VIDEO_RATE_TYPES, + JOB_PRIORITY, VIDEO_TRANSCODING_FPS, FFMPEG_NICE, ABUSE_STATES, -- cgit v1.2.3