Skip to content

Commit

Permalink
起動時にレコーダーが立ち上がるのを待つようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
shunsuke-shimomura committed Jun 29, 2024
1 parent 0e5c7e5 commit 60927a9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tmtc-c2a/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ async fn main() -> Result<()> {
)?;

let recorder_client = if let Some(recorder_endpoint) = args.recorder_endpoint {
let recorder_client_channel = Channel::builder(recorder_endpoint).connect().await?;
let recorder_client_channel = loop {
match Channel::builder(recorder_endpoint.clone()).connect().await {
Ok(channel) => break channel,
Err(e) => {
tracing::warn!(message = "recorder not available", %e);
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
}
}
};
let recorder_client = RecorderClient::new(recorder_client_channel);
Some(recorder_client)
} else {
Expand Down

0 comments on commit 60927a9

Please sign in to comment.