Skip to content

Commit 4b18678

Browse files
committed
Inline method
1 parent 04f7783 commit 4b18678

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

ui/src/server_axum/websocket.rs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::{
1616
collections::BTreeMap,
1717
convert::TryFrom,
1818
mem,
19-
ops::ControlFlow,
2019
pin::pin,
2120
sync::{
2221
atomic::{AtomicU64, Ordering},
@@ -477,16 +476,16 @@ async fn handle_core(
477476
.collect();
478477
}
479478

480-
IdleTimeout => {
481-
if handle_idle(&mut manager, &tx).await.is_break() {
482-
break;
479+
IdleTimeout | IdleRequest => {
480+
if let IdleRequest = event {
481+
info!("Container requested to idle");
483482
}
484-
}
485483

486-
IdleRequest => {
487-
info!("Container requested to idle");
484+
let idled = manager.idle().await.context(StreamingCoordinatorIdleSnafu);
485+
let Err(error) = idled else { continue };
488486

489-
if handle_idle(&mut manager, &tx).await.is_break() {
487+
if tx.send(Err((error, None))).await.is_err() {
488+
// We can't send a response
490489
break;
491490
}
492491
}
@@ -539,21 +538,6 @@ fn response_to_message(response: MessageResponse) -> Message {
539538
Message::Text(resp.into())
540539
}
541540

542-
async fn handle_idle(manager: &mut CoordinatorManager, tx: &ResponseTx) -> ControlFlow<()> {
543-
let idled = manager.idle().await.context(StreamingCoordinatorIdleSnafu);
544-
545-
let Err(error) = idled else {
546-
return ControlFlow::Continue(());
547-
};
548-
549-
if tx.send(Err((error, None))).await.is_err() {
550-
// We can't send a response
551-
return ControlFlow::Break(());
552-
}
553-
554-
ControlFlow::Continue(())
555-
}
556-
557541
type ActiveExecutionInfo = (DropGuard, Option<mpsc::Sender<String>>);
558542

559543
async fn handle_msg(

0 commit comments

Comments
 (0)