Skip to content

Commit

Permalink
reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
jb-alvarado committed Jan 22, 2025
1 parent 794a5de commit ad9707d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 7 additions & 7 deletions engine/src/player/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,6 @@ impl ChannelManager {
let timer = Instant::now();

if let Err(e) = run_channel(self_clone.clone()).await {
trace!(
"Runtime has {} active tasks",
tokio::runtime::Handle::current()
.metrics()
.num_alive_tasks()
);

if let Err(e) = self_clone.stop_all(false).await {
error!(target: Target::all(), channel = channel_id; "Failed to stop channel <yellow>{channel_id}</>: {e}");
break;
Expand All @@ -168,6 +161,13 @@ impl ChannelManager {

error!(target: Target::all(), channel = channel_id; "Run channel <yellow>{channel_id}</> failed: {e} | {retry_msg}");

trace!(
"Runtime has <yellow>{}</> active tasks",
tokio::runtime::Handle::current()
.metrics()
.num_alive_tasks()
);

sleep(retry_delay).await;
}
}
Expand Down
8 changes: 7 additions & 1 deletion engine/src/player/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,13 @@ pub async fn player(manager: ChannelManager) -> Result<(), ServiceError> {
result??;
}

result = async { if let Some(f) = handle_ingest { f.await? } else { Ok(()) } }, if handle_ingest.is_some() => {
result = async {
if let Some(f) = handle_ingest {
f.await?
} else {
Ok(())
}
}, if handle_ingest.is_some() => {
result?;
}

Expand Down

0 comments on commit ad9707d

Please sign in to comment.