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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user