|
@@ -2,10 +2,10 @@ package main
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"log"
|
|
|
mu "mfw/util"
|
|
|
"net"
|
|
|
- "qfw/common/src/qfw/util"
|
|
|
qu "qfw/util"
|
|
|
"sync"
|
|
|
"time"
|
|
@@ -32,12 +32,12 @@ func increaseRepeat(mapInfo map[string]interface{}) {
|
|
|
if total%1000 == 0 {
|
|
|
log.Println("current index : ", total, isok)
|
|
|
}
|
|
|
- if util.IntAll(tmp["repeat"]) == 1 {
|
|
|
+ if qu.IntAll(tmp["repeat"]) == 1 {
|
|
|
repeatN++
|
|
|
tmp = make(map[string]interface{})
|
|
|
continue
|
|
|
}
|
|
|
- if util.IntAll(tmp["dataging"]) == 1 && !IsFull{
|
|
|
+ if qu.IntAll(tmp["dataging"]) == 1 && !IsFull{
|
|
|
tmp = make(map[string]interface{})
|
|
|
continue
|
|
|
}
|
|
@@ -60,7 +60,7 @@ func increaseRepeat(mapInfo map[string]interface{}) {
|
|
|
pool := make(chan bool, threadNum)
|
|
|
wg := &sync.WaitGroup{}
|
|
|
for _,dataArr := range dataAllDict {
|
|
|
- log.Println("处理中...","当前重复量~", repeatN)
|
|
|
+ fmt.Print("...")
|
|
|
pool <- true
|
|
|
wg.Add(1)
|
|
|
go func(dataArr []map[string]interface{}) {
|
|
@@ -113,7 +113,7 @@ func increaseRepeat(mapInfo map[string]interface{}) {
|
|
|
"repeat_reason": reason,
|
|
|
"repeat_id": source.id,
|
|
|
"dataging": 0,
|
|
|
- "updatetime_repeat" :util.Int64All(time.Now().Unix()),
|
|
|
+ "updatetime_repeat" :qu.Int64All(time.Now().Unix()),
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -126,7 +126,8 @@ func increaseRepeat(mapInfo map[string]interface{}) {
|
|
|
}(dataArr)
|
|
|
}
|
|
|
wg.Wait()
|
|
|
- log.Println("this cur task over.", total, "repeateN:", repeatN)
|
|
|
+ log.Println("")
|
|
|
+ log.Println("当前~判重~结束~", total, "重复~", repeatN)
|
|
|
//更新Ocr的标记
|
|
|
updateOcrFileData(mapInfo["lteid"].(string))
|
|
|
time.Sleep(15 * time.Second)
|
|
@@ -135,16 +136,16 @@ func increaseRepeat(mapInfo map[string]interface{}) {
|
|
|
for _, to := range nextNode {
|
|
|
sid, _ := mapInfo["gtid"].(string)
|
|
|
eid, _ := mapInfo["lteid"].(string)
|
|
|
- key := sid + "-" + eid + "-" + util.ObjToString(to["stype"])
|
|
|
+ key := sid + "-" + eid + "-" + qu.ObjToString(to["stype"])
|
|
|
by, _ := json.Marshal(map[string]interface{}{
|
|
|
"gtid": sid,
|
|
|
"lteid": eid,
|
|
|
- "stype": util.ObjToString(to["stype"]),
|
|
|
+ "stype": qu.ObjToString(to["stype"]),
|
|
|
"key": key,
|
|
|
})
|
|
|
addr := &net.UDPAddr{
|
|
|
IP: net.ParseIP(to["addr"].(string)),
|
|
|
- Port: util.IntAll(to["port"]),
|
|
|
+ Port: qu.IntAll(to["port"]),
|
|
|
}
|
|
|
node := &udpNode{by, addr, time.Now().Unix(), 0}
|
|
|
udptaskmap.Store(key, node)
|
|
@@ -163,7 +164,7 @@ func updateOcrFileData(cur_lteid string) {
|
|
|
updateOcrFile:=[][]map[string]interface{}{}
|
|
|
for tmp := make(map[string]interface{}); it_last.Next(&tmp); {
|
|
|
cur_id := BsonTOStringId(tmp["_id"])
|
|
|
- lteid:=util.ObjToString(tmp["lteid"])
|
|
|
+ lteid:=qu.ObjToString(tmp["lteid"])
|
|
|
if (lteid==cur_lteid) { //需要更新
|
|
|
log.Println("找到该lteid数据",cur_lteid,cur_id)
|
|
|
isUpdateOcr = true
|
|
@@ -174,7 +175,7 @@ func updateOcrFileData(cur_lteid string) {
|
|
|
map[string]interface{}{
|
|
|
"$set": map[string]interface{}{
|
|
|
"is_repeat_status": 1,
|
|
|
- "is_repeat_time" : util.Int64All(time.Now().Unix()),
|
|
|
+ "is_repeat_time" : qu.Int64All(time.Now().Unix()),
|
|
|
},
|
|
|
},
|
|
|
})
|