From 8d3faa3d3d765441a0753748c92079db08fb8374 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 4 Oct 2023 10:18:52 +0200 Subject: limit number of local transcoding tasks --- transcoder/src/snippet.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'transcoder/src/snippet.rs') diff --git a/transcoder/src/snippet.rs b/transcoder/src/snippet.rs index 42847a0..e9569da 100644 --- a/transcoder/src/snippet.rs +++ b/transcoder/src/snippet.rs @@ -4,6 +4,7 @@ Copyright (C) 2023 metamuffin */ +use crate::LOCAL_TRANSCODING_TASKS; use jellybase::cache::async_cache_file; use jellycommon::{jhls::EncodingProfile, AssetLocation}; use log::info; @@ -21,6 +22,7 @@ pub async fn transcode( Ok(async_cache_file( &["snip-tc", key, &format!("{enc:?}")], move |mut output| async move { + let _permit = LOCAL_TRANSCODING_TASKS.acquire().await?; info!("transcoding snippet {key}"); let args = match enc { EncodingProfile::Video { -- cgit v1.2.3-70-g09d2