Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into haoyu/sindri_tokio
Browse files Browse the repository at this point in the history
  • Loading branch information
lispc committed Oct 24, 2024
2 parents d717a1f + 3033e3e commit 4d0ebd1
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/prover/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,11 @@ impl Prover {
assert!(self.l2geth_client.is_some());
}

// Use the first coordinator client to test the connection
match self.coordinator_clients[0].get_token(true).await {
Ok(_) => {}
Err(e) => {
panic!("Failed to login: {:?}", e);
}
};
self.test_coordinator_connection().await;

let app = Router::new().route("/", get(|| async { "OK" }));
let addr = SocketAddr::from_str(&self.health_listener_addr).expect("Failed to parse socket address");
let addr = SocketAddr::from_str(&self.health_listener_addr)
.expect("Failed to parse socket address");
let server = axum::Server::bind(&addr).serve(app.into_make_service());
let health_check_server_task = tokio::spawn(server);

Expand All @@ -65,6 +60,13 @@ impl Prover {
}
}

async fn test_coordinator_connection(&self) {
self.coordinator_clients[0]
.get_token(true)
.await
.expect("Failed to login to coordinator");
}

#[instrument(skip(self))]
async fn working_loop(&self, i: usize) {
loop {
Expand Down

0 comments on commit 4d0ebd1

Please sign in to comment.