Skip to content

Commit

Permalink
Return Err instead of Ok when retry_on_error
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchTurner committed Mar 28, 2024
1 parent daabb9d commit b249ebb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/services/relayer/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ where
{
async fn run(&mut self, _: &mut StateWatcher) -> anyhow::Result<bool> {
let now = tokio::time::Instant::now();
let mut should_continue = true;

let result = run::run(self).await;

Expand All @@ -242,11 +241,15 @@ where
if let Err(err) = result {
if !self.retry_on_error {
tracing::error!("Exiting due to Error in relayer task: {:?}", err);
should_continue = false;
let should_continue = false;
Ok(should_continue)
} else {
Err(err)
}
} else {
let should_continue = true;
Ok(should_continue)
}

Ok(should_continue)
}

async fn shutdown(self) -> anyhow::Result<()> {
Expand Down

0 comments on commit b249ebb

Please sign in to comment.