Skip to content

Commit 43d0508

Browse files
authored
dont swallow errors in schedulejob function (#1486)
1 parent fc5f816 commit 43d0508

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

backend/services/scheduler.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ func ScheduleJob(client *github.Client, repoOwner string, repoName string, batch
5555
maxConcurrencyForBatch := config.DiggerConfig.GetInt("max_concurrency_per_batch")
5656
if maxConcurrencyForBatch == 0 {
5757
// concurrency limits not set
58-
TriggerJob(client, repoOwner, repoName, batchId, job)
58+
err := TriggerJob(client, repoOwner, repoName, batchId, job)
59+
if err != nil {
60+
log.Printf("Could not trigger job: %v", err)
61+
return err
62+
}
5963
} else {
6064
// concurrency limits set
6165
log.Printf("Scheduling job with concurrency limit: %v per batch", maxConcurrencyForBatch)
@@ -74,7 +78,11 @@ func ScheduleJob(client *github.Client, repoOwner string, repoName string, batch
7478
models.DB.UpdateDiggerJob(job)
7579
return nil
7680
} else {
77-
TriggerJob(client, repoOwner, repoName, batchId, job)
81+
err := TriggerJob(client, repoOwner, repoName, batchId, job)
82+
if err != nil {
83+
log.Printf("Could not trigger job: %v", err)
84+
return err
85+
}
7886
}
7987
}
8088
return nil

0 commit comments

Comments
 (0)