|
@@ -60,16 +60,6 @@ func (a *AnalyzeTask) Run() {
|
|
es.NewRangeQuery("jgtime").Gte(a.StartTime).Lte(a.EndTime),
|
|
es.NewRangeQuery("jgtime").Gte(a.StartTime).Lte(a.EndTime),
|
|
es.NewTermsQuery("bidstatus", consts.BidStatus...),
|
|
es.NewTermsQuery("bidstatus", consts.BidStatus...),
|
|
)
|
|
)
|
|
- // 打印查询语句
|
|
|
|
- //source, err := query.Source()
|
|
|
|
- //if err != nil {
|
|
|
|
- // g.Log().Info(model.Ctx, "---1---", err)
|
|
|
|
- //}
|
|
|
|
- //queryJSON, err := json.MarshalIndent(source, "", " ")
|
|
|
|
- //if err != nil {
|
|
|
|
- // g.Log().Info(model.Ctx, "---2---", err)
|
|
|
|
- //}
|
|
|
|
- //g.Log().Info(model.Ctx, "---3---", string(queryJSON))
|
|
|
|
client := do.Es.GetEsConn()
|
|
client := do.Es.GetEsConn()
|
|
defer do.Es.DestoryEsConn(client)
|
|
defer do.Es.DestoryEsConn(client)
|
|
// 创建一个搜索服务对象,并设置查询条件和排序
|
|
// 创建一个搜索服务对象,并设置查询条件和排序
|
|
@@ -107,10 +97,19 @@ func (a *AnalyzeTask) Run() {
|
|
for _, hit := range results.Hits.Hits {
|
|
for _, hit := range results.Hits.Hits {
|
|
p := &entity.ProjectInfo{}
|
|
p := &entity.ProjectInfo{}
|
|
if err := json.Unmarshal(hit.Source, p); err == nil {
|
|
if err := json.Unmarshal(hit.Source, p); err == nil {
|
|
- for _, ui := range a.UI {
|
|
|
|
|
|
+ for uk, ui := range a.UI {
|
|
if ui.FormatParam.STime <= p.JgTime && ui.FormatParam.ETime >= p.JgTime {
|
|
if ui.FormatParam.STime <= p.JgTime && ui.FormatParam.ETime >= p.JgTime {
|
|
ui.Start()
|
|
ui.Start()
|
|
ui.Push(p)
|
|
ui.Push(p)
|
|
|
|
+ //
|
|
|
|
+ if iterationTimes%20 == 0 {
|
|
|
|
+ ui.IsCancel = utility.IsAnalyzeCancel(ui.RId)
|
|
|
|
+ }
|
|
|
|
+ if ui.IsCancel {
|
|
|
|
+ ui.Reset()
|
|
|
|
+ a.UI = append(a.UI[:uk], a.UI[uk+1:]...)
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|