Skip to content

Commit 050a6b6

Browse files
author
zsbahtiar
committed
feat: add GetRunJobsByRunIDs
1 parent 0b27261 commit 050a6b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

models/actions/run_job.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,11 @@ func AggregateJobStatus(jobs []*ActionRunJob) Status {
184184
return StatusUnknown // it shouldn't happen
185185
}
186186
}
187+
188+
func GetRunJobsByRunIDs(ctx context.Context, runIDs []int64) ([]*ActionRunJob, error) {
189+
var jobs []*ActionRunJob
190+
if err := db.GetEngine(ctx).In("run_id", runIDs).Find(&jobs); err != nil {
191+
return nil, err
192+
}
193+
return jobs, nil
194+
}

0 commit comments

Comments
 (0)