diff --git a/livekit-ffi/src/server/logger.rs b/livekit-ffi/src/server/logger.rs index 3435b4de..7026c5e9 100644 --- a/livekit-ffi/src/server/logger.rs +++ b/livekit-ffi/src/server/logger.rs @@ -73,7 +73,7 @@ impl Log for FfiLogger { return self.env_logger.flush(); } - let (tx, mut rx) = oneshot::channel(); + let (tx, rx) = oneshot::channel(); self.log_tx.send(LogMsg::Flush(tx)).unwrap(); let _ = self.server.async_runtime.block_on(rx); // should we block? } @@ -97,8 +97,12 @@ async fn log_forward_task(server: &'static FfiServer, mut rx: mpsc::UnboundedRec loop { tokio::select! { - Some(msg) = rx.recv() => { - match msg { + msg = rx.recv() => { + if msg.is_none() { + break; + } + + match msg.unwrap() { LogMsg::Log(record) => { batch.push(record); } diff --git a/livekit-ffi/src/server/requests.rs b/livekit-ffi/src/server/requests.rs index 08326b8c..6534aee4 100644 --- a/livekit-ffi/src/server/requests.rs +++ b/livekit-ffi/src/server/requests.rs @@ -14,8 +14,8 @@ use super::room::{FfiParticipant, FfiPublication, FfiTrack}; use super::{ - audio_source, audio_stream, logger::FfiLogger, room, video_source, video_stream, FfiConfig, - FfiError, FfiResult, FfiServer, + audio_source, audio_stream, room, video_source, video_stream, FfiConfig, FfiError, FfiResult, + FfiServer, }; use crate::proto; use livekit::prelude::*;