Skip to content

Commit

Permalink
ensure signer doesn't exit on connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
roeierez authored and cdecker committed Oct 7, 2024
1 parent b779b48 commit 4b54918
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions libs/gl-client/src/signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ impl Signer {
msg: e.to_string(),
request: Some(req.clone()),
git_version: GITHASH.to_string(),
node_id: self.node_id(),
node_id: self.node_id(),
})
.await;
#[cfg(not(feature = "permissive"))]
Expand Down Expand Up @@ -569,7 +569,7 @@ impl Signer {
msg: format!("{:?}", e),
request: Some(req.clone()),
git_version: GITHASH.to_string(),
node_id: self.node_id(),
node_id: self.node_id(),
})
.await;
return Err(Error::Other(anyhow!("processing request: {e:?}")));
Expand Down Expand Up @@ -816,6 +816,17 @@ impl Signer {
}

async fn run_forever_scheduler(
&self,
scheduler: SchedulerClient<tonic::transport::Channel>,
) -> Result<(), anyhow::Error> {
loop {
if let Err(e) = self.run_once_scheduler(scheduler.clone()).await {
warn!("Error running schduler, trying again: {e}");
}
}
}

async fn run_once_scheduler(
&self,
mut scheduler: SchedulerClient<tonic::transport::Channel>,
) -> Result<(), anyhow::Error> {
Expand Down

0 comments on commit 4b54918

Please sign in to comment.