Skip to content

Commit

Permalink
fix: gracefully handle context cancelation when polling deployments (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored Jul 22, 2024
1 parent 8767717 commit 837eae1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/controller/dal/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ func (d *DAL) PollDeployments(ctx context.Context) {

deployments, err := d.GetDeploymentsWithMinReplicas(ctx)
if err != nil {
logger.Errorf(err, "failed to get deployments")
if ctx.Err() == context.Canceled {
logger.Debugf("Polling stopped: %v", ctx.Err())
return
}
logger.Errorf(err, "failed to get deployments when polling")
time.Sleep(retry.Duration())
continue
}
Expand Down

0 comments on commit 837eae1

Please sign in to comment.