Merge pull request #14452 from ywk253100/210315_duplicated_task

Add order by ID when listing tasks to avoid duplicated records
This commit is contained in:
Wenkai Yin(尹文开) 2021-03-16 15:36:52 +08:00 committed by GitHub
commit f4655bbacd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,7 +76,7 @@ func (t *taskDAO) List(ctx context.Context, query *q.Query) ([]*Task, error) {
if err != nil {
return nil, err
}
qs = qs.OrderBy("-StartTime")
qs = qs.OrderBy("-StartTime", "ID")
if _, err = qs.All(&tasks); err != nil {
return nil, err
}