From a2ef3f6ec4c830611fde1a2e935588ccbbc61c03 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 30 Apr 2025 10:47:54 +0200 Subject: config works --- transcoder/src/lib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'transcoder/src/lib.rs') diff --git a/transcoder/src/lib.rs b/transcoder/src/lib.rs index c49f52c..665f470 100644 --- a/transcoder/src/lib.rs +++ b/transcoder/src/lib.rs @@ -6,8 +6,8 @@ #![feature(exit_status_error)] use serde::{Deserialize, Serialize}; -use std::sync::LazyLock; -use tokio::sync::{Mutex, Semaphore}; +use std::sync::{LazyLock, Mutex}; +use tokio::sync::Semaphore; pub mod fragment; pub mod image; @@ -27,13 +27,14 @@ pub struct Config { pub x264_preset: Option, } +pub static CONF_PRELOAD: Mutex> = Mutex::new(None); static CONF: LazyLock = LazyLock::new(|| { CONF_PRELOAD - .blocking_lock() + .lock() + .unwrap() .take() - .expect("cache config not preloaded. logic error") + .expect("transcoder config not preloaded. logic error") }); -static CONF_PRELOAD: Mutex> = Mutex::const_new(None); static LOCAL_IMAGE_TRANSCODING_TASKS: Semaphore = Semaphore::const_new(8); static LOCAL_VIDEO_TRANSCODING_TASKS: Semaphore = Semaphore::const_new(2); -- cgit v1.2.3-70-g09d2