Skip to content

Commit

Permalink
Short-circuit Slack sync runs on context expiry
Browse files Browse the repository at this point in the history
There is no value in trying to complete remaining Slack syncs if the
context has expired.
  • Loading branch information
timoreimann committed Sep 26, 2024
1 parent d84c68b commit 127c3e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (s *syncer) Run(ctx context.Context, slackSyncs []runSlackSync, failFast bo
err := s.runSlackSync(ctx, slackSync)
if err != nil {
msg := fmt.Sprintf("failed to run Slack sync %s: %s", slackSync.name, err)
if failFast {
if failFast || ctx.Err() != nil {
return errors.New(msg)
}

Expand Down

0 comments on commit 127c3e0

Please sign in to comment.