|
@@ -21,15 +21,16 @@ func increaseRepeat(mapInfo map[string]interface{}) {
|
|
|
"$lte": StringTOBsonId(mapInfo["lteid"].(string)),
|
|
|
},
|
|
|
}
|
|
|
+ log.Println("~~~~~~")
|
|
|
log.Println("开始增量数据判重~查询条件:",data_mgo.DbName, extract, q)
|
|
|
sess := data_mgo.GetMgoConn()
|
|
|
defer data_mgo.DestoryMongoConn(sess)
|
|
|
it := sess.DB(data_mgo.DbName).C(extract).Find(&q).Sort("publishtime").Iter()
|
|
|
- n, isok ,repeatN:= 0,0,0
|
|
|
+ total, isok ,repeatN:= 0,0,0
|
|
|
dataAllDict := make(map[string][]map[string]interface{},0)
|
|
|
- for tmp := make(map[string]interface{}); it.Next(&tmp); n++ {
|
|
|
- if n%1000 == 0 {
|
|
|
- log.Println("index: ", n, isok)
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
+ if total%1000 == 0 {
|
|
|
+ log.Println("index: ", total, isok)
|
|
|
}
|
|
|
if util.IntAll(tmp["repeat"]) == 1 {
|
|
|
repeatN++
|
|
@@ -55,7 +56,7 @@ func increaseRepeat(mapInfo map[string]interface{}) {
|
|
|
dataAllDict[subtype] = dataArr
|
|
|
tmp = make(map[string]interface{})
|
|
|
}
|
|
|
- log.Println("类别组划分完毕:",len(dataAllDict),"组","~","需要判重:",isok,"条")
|
|
|
+ log.Println("类别组:",len(dataAllDict),"组","~","总计:",total,"~","需判重:",isok)
|
|
|
pool := make(chan bool, threadNum)
|
|
|
wg := &sync.WaitGroup{}
|
|
|
for _,dataArr := range dataAllDict {
|
|
@@ -98,7 +99,7 @@ func increaseRepeat(mapInfo map[string]interface{}) {
|
|
|
}(dataArr)
|
|
|
}
|
|
|
wg.Wait()
|
|
|
- log.Println("this cur task over.", n, "repeateN:", repeatN)
|
|
|
+ log.Println("this cur task over.", total, "repeateN:", repeatN)
|
|
|
//更新Ocr的标记
|
|
|
updateOcrFileData(mapInfo["lteid"].(string))
|
|
|
time.Sleep(15 * time.Second)
|