aboutsummaryrefslogtreecommitdiff
path: root/transcoder/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-04-30 10:47:54 +0200
committermetamuffin <metamuffin@disroot.org>2025-04-30 10:47:54 +0200
commita2ef3f6ec4c830611fde1a2e935588ccbbc61c03 (patch)
treeddcc1cb501e6c7237edd491aa7136d02150d03d3 /transcoder/src/lib.rs
parent212a0f23bc894faf88e159560c113f504349cc05 (diff)
downloadjellything-a2ef3f6ec4c830611fde1a2e935588ccbbc61c03.tar
jellything-a2ef3f6ec4c830611fde1a2e935588ccbbc61c03.tar.bz2
jellything-a2ef3f6ec4c830611fde1a2e935588ccbbc61c03.tar.zst
config works
Diffstat (limited to 'transcoder/src/lib.rs')
-rw-r--r--transcoder/src/lib.rs11
1 files changed, 6 insertions, 5 deletions
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<String>,
}
+pub static CONF_PRELOAD: Mutex<Option<Config>> = Mutex::new(None);
static CONF: LazyLock<Config> = 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<Option<Config>> = Mutex::const_new(None);
static LOCAL_IMAGE_TRANSCODING_TASKS: Semaphore = Semaphore::const_new(8);
static LOCAL_VIDEO_TRANSCODING_TASKS: Semaphore = Semaphore::const_new(2);