Skip to content

Commit

Permalink
fix: dont panic when in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
lynzrand committed Oct 5, 2020
1 parent cef0beb commit 566f983
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions judger/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,12 @@ async fn client(cmd: opt::ConnectSubCmd) {
ABORT_HANDLE.set(handle).unwrap();

let sink = loop {
let (sink, stream) = connect_to_coordinator(&client_config)
.await
.expect("Failed to connect");
let (sink, stream) = match connect_to_coordinator(&client_config).await {
Ok(e) => e,
Err(e) => {
continue;
}
};
let sink = client_loop(stream, sink, client_config.clone()).await;
if client_config.cancel_handle.is_cancelled() {
break sink;
Expand Down

0 comments on commit 566f983

Please sign in to comment.