Skip to content

Commit

Permalink
fix(rust): return the last error for a retried command
Browse files Browse the repository at this point in the history
and fix the node name for a simple config
  • Loading branch information
etorreborre committed Jul 15, 2024
1 parent 85f0cc2 commit 91ed3e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions implementations/rust/ockam/ockam_command/src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ pub trait Command: Clone + Sized + Send + Sync + 'static {
Ok(_) => break,
Err(Error::Retry(inner)) => {
retry_count -= 1;
// return the last error if there are no more retries
if retry_count == 0 {
return Err(inner);
};

let delay = retry_delay.add(jitter(retry_delay_jitter));
warn!(
"Command failed, retrying in {} seconds: {inner:?}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
variables:
NODE_NAME: n1

name: $NODE_NAME

relay: $RELAY_NAME

tcp-outlet:
Expand Down

0 comments on commit 91ed3e0

Please sign in to comment.