Skip to content

Commit 02ff74b

Browse files
Merge pull request #254 from mercedes-benz/fix_conclusion_typo
fix: use the american english type of cancelled
2 parents 7538f4a + 7adc48c commit 02ff74b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

runner/pool/pool.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func (r *basePoolManager) startLoopForFunction(f func() error, interval time.Dur
336336
// this worker was stopped.
337337
return
338338
default:
339-
r.waitForTimeoutOrCanceled(common.BackoffTimer)
339+
r.waitForTimeoutOrCancelled(common.BackoffTimer)
340340
}
341341
}
342342
}
@@ -785,7 +785,7 @@ func (r *basePoolManager) Status() params.PoolManagerStatus {
785785
}
786786
}
787787

788-
func (r *basePoolManager) waitForTimeoutOrCanceled(timeout time.Duration) {
788+
func (r *basePoolManager) waitForTimeoutOrCancelled(timeout time.Duration) {
789789
slog.DebugContext(
790790
r.ctx, fmt.Sprintf("sleeping for %.2f minutes", timeout.Minutes()))
791791
select {
@@ -900,9 +900,9 @@ func (r *basePoolManager) getRunnerDetailsFromJob(job params.WorkflowJob) (param
900900

901901
var err error
902902
if job.WorkflowJob.RunnerName == "" {
903-
if job.WorkflowJob.Conclusion == "skipped" || job.WorkflowJob.Conclusion == "canceled" {
904-
// job was skipped or canceled before a runner was allocated. No point in continuing.
905-
return params.RunnerInfo{}, fmt.Errorf("job %d was skipped or canceled before a runner was allocated: %w", job.WorkflowJob.ID, runnerErrors.ErrNotFound)
903+
if job.WorkflowJob.Conclusion == "skipped" || job.WorkflowJob.Conclusion == "cancelled" {
904+
// job was skipped or cancelled before a runner was allocated. No point in continuing.
905+
return params.RunnerInfo{}, fmt.Errorf("job %d was skipped or cancelled before a runner was allocated: %w", job.WorkflowJob.ID, runnerErrors.ErrNotFound)
906906
}
907907
// Runner name was not set in WorkflowJob by github. We can still attempt to
908908
// fetch the info we need, using the workflow run ID, from the API.
@@ -964,7 +964,7 @@ func (r *basePoolManager) paramsWorkflowJobToParamsJob(job params.WorkflowJob) (
964964

965965
runnerName := job.WorkflowJob.RunnerName
966966
if job.Action != "queued" && runnerName == "" {
967-
if job.WorkflowJob.Conclusion != "skipped" && job.WorkflowJob.Conclusion != "canceled" {
967+
if job.WorkflowJob.Conclusion != "skipped" && job.WorkflowJob.Conclusion != "cancelled" {
968968
// Runner name was not set in WorkflowJob by github. We can still attempt to fetch the info we need,
969969
// using the workflow run ID, from the API.
970970
// We may still get no runner name. In situations such as jobs being cancelled before a runner had the chance

0 commit comments

Comments
 (0)