1
1
mirror of https://github.com/go-gitea/gitea synced 2025-10-28 01:48:25 +00:00

feat: api for fetch job state

This commit is contained in:
Jason Song
2022-10-13 17:38:47 +08:00
parent b7aaa3ba77
commit 027d748fe2
4 changed files with 135 additions and 2 deletions

View File

@@ -80,3 +80,11 @@ func GetRunJobByID(ctx context.Context, id int64) (*RunJob, error) {
return &job, nil
}
func GetRunJobsByRunID(ctx context.Context, runID int64) ([]*RunJob, error) {
var jobs []*RunJob
if err := db.GetEngine(ctx).Where("run_id=?", runID).Find(&jobs); err != nil {
return nil, err
}
return jobs, nil
}