Skip to content

Commit

Permalink
Merge pull request #3 from brody192/skip-not-exit
Browse files Browse the repository at this point in the history
skip a job if max retry duration reached instead of exiting the application
  • Loading branch information
brody192 authored Aug 12, 2024
2 parents 144d801 + 7efb830 commit d03bb77
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func main() {

return nil
}); err != nil {
logger.Stderr.Error("attempt duration reached, exiting")
os.Exit(1)
logger.Stderr.Error("attempt duration reached, skipping")
return
}

// run action depending on the action type
Expand All @@ -108,8 +108,8 @@ func main() {

return nil
}); err != nil {
logger.Stderr.Error("attempt duration reached, exiting")
os.Exit(1)
logger.Stderr.Error("attempt duration reached, skipping")
return
}
case schedule.ActionRestart:
if err := retry.Do(context.Background(), backoffParams, func(ctx context.Context) error {
Expand All @@ -121,8 +121,8 @@ func main() {

return nil
}); err != nil {
logger.Stderr.Error("attempt duration reached, exiting")
os.Exit(1)
logger.Stderr.Error("attempt duration reached, skipping")
return
}
default:
slogAttr = append(slogAttr, slog.String("action", string(jobDetails.Action)))
Expand Down

0 comments on commit d03bb77

Please sign in to comment.