fix: use index of run

This commit is contained in:
Jason Song
2022-11-25 17:48:46 +08:00
parent 9292e9ebdb
commit 3d4d44dadf
6 changed files with 70 additions and 55 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ func GetRunJobByID(ctx context.Context, id int64) (*RunJob, error) {
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 {
if err := db.GetEngine(ctx).Where("run_id=?", runID).OrderBy("id").Find(&jobs); err != nil {
return nil, err
}
return jobs, nil