Skip to content

Commit

Permalink
Make model_route exit gracefully.
Browse files Browse the repository at this point in the history
  • Loading branch information
cryscan committed May 21, 2024
1 parent 3228cc7 commit 21d0f16
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/ai00-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,13 @@ pub async fn model_route(receiver: Receiver<ThreadRequest>) -> Result<()> {
tokio::spawn(dequeue);

loop {
let Ok(request) = receiver.recv_async().await else {
log::info!("core exit");
break Ok(());
};

let listen = async {
match receiver.recv_async().await.unwrap() {
match request {
ThreadRequest::Adapter(sender) => {
tokio::spawn(async move {
let _ = sender.send(list_adapters());
Expand Down

0 comments on commit 21d0f16

Please sign in to comment.