This commit is contained in:
parent
8fcef422bb
commit
2e08c98384
|
@ -61,6 +61,7 @@ type OpListReq struct {
|
||||||
Limit int `json:"limit"`
|
Limit int `json:"limit"`
|
||||||
Sort string
|
Sort string
|
||||||
NotAlignedOpt int
|
NotAlignedOpt int
|
||||||
|
IndexName string
|
||||||
}
|
}
|
||||||
|
|
||||||
type OpListData struct {
|
type OpListData struct {
|
||||||
|
|
|
@ -3471,6 +3471,7 @@ func (m *Mongo) GetImageAuditTaskList(ctx *gin.Context, req *imageaudittaskproto
|
||||||
if req.Sort != "" {
|
if req.Sort != "" {
|
||||||
sortClause = req.Sort
|
sortClause = req.Sort
|
||||||
}
|
}
|
||||||
|
opt := options2.Find().SetHint(req.IndexName)
|
||||||
err := col.Find(ctx, query).Sort(sortClause).Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
|
err := col.Find(ctx, query).Sort(sortClause).Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
|
||||||
if err == qmgo.ErrNoSuchDocuments {
|
if err == qmgo.ErrNoSuchDocuments {
|
||||||
err = nil
|
err = nil
|
||||||
|
|
|
@ -3163,7 +3163,7 @@ func (s *Service) OpGetImageAuditTaskVOList(ctx *gin.Context, req *imageaudittas
|
||||||
|
|
||||||
// 仅查询未对齐的任务
|
// 仅查询未对齐的任务
|
||||||
req.NotAlignedOpt = 1
|
req.NotAlignedOpt = 1
|
||||||
|
req.IndexName = "idx_list" // 指定索引
|
||||||
list, err := _DefaultImageAuditTask.OpList(ctx, req)
|
list, err := _DefaultImageAuditTask.OpList(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("OpGetImageAuditTaskListByMid fail, req: %v, err: %v", util.ToJson(req), err)
|
logger.Error("OpGetImageAuditTaskListByMid fail, req: %v, err: %v", util.ToJson(req), err)
|
||||||
|
|
|
@ -33,9 +33,10 @@ func Run(batchId string) (successNum int, failNum int, err error) {
|
||||||
|
|
||||||
// 查询该批次所有审核任务
|
// 查询该批次所有审核任务
|
||||||
imageaudittasks, err := _DefaultImageAuditTask.OpList(&gin.Context{}, &imageaudittaskproto.OpListReq{
|
imageaudittasks, err := _DefaultImageAuditTask.OpList(&gin.Context{}, &imageaudittaskproto.OpListReq{
|
||||||
BatchId: goproto.String(batchId),
|
BatchId: goproto.String(batchId),
|
||||||
Status: goproto.Int64(consts.ImageAudit_Created),
|
Status: goproto.Int64(consts.ImageAudit_Created),
|
||||||
Sort: "ct",
|
Sort: "ct",
|
||||||
|
IndexName: "idx_batch_id",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Info("_DefaultImageAuditTask OpList fail: %v", err)
|
logger.Info("_DefaultImageAuditTask OpList fail: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue