Skip to content

Commit

Permalink
Only output last error of retries (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg authored Apr 6, 2024
1 parent ab79e39 commit 0448a2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion java_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ func (c *statusCmd) Execute(_ context.Context, _ *flag.FlagSet, args ...interfac

return nil

}, retry.Delay(c.RetryInterval), retry.DelayType(retry.FixedDelay), retry.Attempts(uint(c.RetryLimit+1)))
},
retry.Delay(c.RetryInterval),
retry.DelayType(retry.FixedDelay),
retry.Attempts(uint(c.RetryLimit+1)),
retry.LastErrorOnly(true))

if err != nil {
_, _ = fmt.Fprintf(os.Stderr, "failed to ping %s:%d : %s", c.Host, c.Port, err)
Expand Down

0 comments on commit 0448a2e

Please sign in to comment.