[task scheduler] Extend time window for buildbucket cleanup
This is mainly just to clean up the builds that were started and never
finished due to bugs that have (presumably) been fixed.
Bug: b/288158829
Change-Id: I71d30be08c4056dfab71015049d9557453c24c93
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/803087
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Eric Boren <borenet@google.com>
diff --git a/task_scheduler/go/tryjobs/tryjobs.go b/task_scheduler/go/tryjobs/tryjobs.go
index 522daa6..a1d503e 100644
--- a/task_scheduler/go/tryjobs/tryjobs.go
+++ b/task_scheduler/go/tryjobs/tryjobs.go
@@ -540,8 +540,12 @@
// findJobForBuild retrieves the Job associated with the given build. Returns
// nil, nil if no build is found.
func (t *TryJobIntegrator) findJobForBuild(ctx context.Context, id int64) (*types.Job, error) {
+ end := now.Now(ctx)
+ start := end.Add(-4 * 24 * time.Hour)
foundJobs, err := t.db.SearchJobs(ctx, &db.JobSearchParams{
BuildbucketBuildID: &id,
+ TimeStart: &start,
+ TimeEnd: &end,
})
if err != nil {
return nil, skerr.Wrapf(err, "failed searching for existing Jobs for build %d", id)