|
@@ -370,15 +370,15 @@ func ExtractByUdpPre(sid, eid string, ra *net.UDPAddr, instanceId ...string) {
|
|
ext.BidTotal = 0
|
|
ext.BidTotal = 0
|
|
}
|
|
}
|
|
query := bson.M{"_id": bson.M{"$gt": bson.ObjectIdHex(sid), "$lte": bson.ObjectIdHex(eid)}}
|
|
query := bson.M{"_id": bson.M{"$gt": bson.ObjectIdHex(sid), "$lte": bson.ObjectIdHex(eid)}}
|
|
- count1 := ext.TaskInfo.FDB.Count("bidding_nomal", query)
|
|
|
|
- count2 := ext.TaskInfo.FDB.Count("bidding_file", query)
|
|
|
|
|
|
+ count1 := ext.TaskInfo.FDB.Count("zktest_bidding_nomal", query)
|
|
|
|
+ count2 := ext.TaskInfo.FDB.Count("zktest_bidding_file", query)
|
|
log.Debug("待抽取数量:", count1+count2)
|
|
log.Debug("待抽取数量:", count1+count2)
|
|
- list1, _ := ext.TaskInfo.FDB.Find("bidding_nomal", query, nil, Fields, false, -1, -1)
|
|
|
|
- list2, _ := ext.TaskInfo.FDB.Find("bidding_file", query, nil, Fields, false, -1, -1)
|
|
|
|
|
|
+ list1, _ := ext.TaskInfo.FDB.Find("zktest_bidding_nomal", query, nil, Fields, false, -1, -1)
|
|
|
|
+ list2, _ := ext.TaskInfo.FDB.Find("zktest_bidding_file", query, nil, Fields, false, -1, -1)
|
|
new_list := append(*list1, *list2...)
|
|
new_list := append(*list1, *list2...)
|
|
now_time := time.Now().Unix()
|
|
now_time := time.Now().Unix()
|
|
total := 0
|
|
total := 0
|
|
- wg_mgo := &sync.WaitGroup{}
|
|
|
|
|
|
+ wg_mgo := sync.WaitGroup{}
|
|
for _, v := range new_list {
|
|
for _, v := range new_list {
|
|
if total%1000 == 0 {
|
|
if total%1000 == 0 {
|
|
log.Debug("cur index :", total, v["_id"])
|
|
log.Debug("cur index :", total, v["_id"])
|
|
@@ -389,16 +389,13 @@ func ExtractByUdpPre(sid, eid string, ra *net.UDPAddr, instanceId ...string) {
|
|
}
|
|
}
|
|
ext.TaskInfo.ProcessPool <- true
|
|
ext.TaskInfo.ProcessPool <- true
|
|
wg_mgo.Add(1)
|
|
wg_mgo.Add(1)
|
|
- go func(v map[string]interface{}) {
|
|
|
|
- defer func() {
|
|
|
|
- <-ext.TaskInfo.ProcessPool
|
|
|
|
- wg_mgo.Done()
|
|
|
|
- }()
|
|
|
|
|
|
+ go func(wg_mgo *sync.WaitGroup, v map[string]interface{}) {
|
|
|
|
+ defer wg_mgo.Done()
|
|
var j, jf *ju.Job
|
|
var j, jf *ju.Job
|
|
var isSite bool
|
|
var isSite bool
|
|
j, _, isSite = ext.PreInfo(v)
|
|
j, _, isSite = ext.PreInfo(v)
|
|
ext.ExtractProcess(j, jf, isSite)
|
|
ext.ExtractProcess(j, jf, isSite)
|
|
- }(v)
|
|
|
|
|
|
+ }(&wg_mgo, v)
|
|
}
|
|
}
|
|
wg_mgo.Wait()
|
|
wg_mgo.Wait()
|
|
log.Debug("抽取完成:", total, ",耗时:", time.Now().Unix()-now_time)
|
|
log.Debug("抽取完成:", total, ",耗时:", time.Now().Unix()-now_time)
|