|
@@ -45,8 +45,8 @@ type Transaction struct {
|
|
|
|
|
|
func IncTransactionDataFromBidAndPro() {
|
|
|
IncTransactionDataFromBid() //bidding
|
|
|
+ IncTransactionDataFromPro() //project
|
|
|
return
|
|
|
- IncTransactionDataFromPro() //project
|
|
|
IncTransactionDataMgoToCkh() //mongodb迁移至clickhouse
|
|
|
}
|
|
|
|
|
@@ -223,8 +223,8 @@ func IncTransactionDataFromPro() {
|
|
|
},
|
|
|
}
|
|
|
fmt.Println("增量项目查询query:", query)
|
|
|
- sess := MgoB.GetMgoConn()
|
|
|
- defer MgoB.DestoryMongoConn(sess)
|
|
|
+ sess := MgoPro.GetMgoConn()
|
|
|
+ defer MgoPro.DestoryMongoConn(sess)
|
|
|
ch := make(chan bool, 5)
|
|
|
wg := &sync.WaitGroup{}
|
|
|
lock := &sync.Mutex{}
|
|
@@ -254,7 +254,7 @@ func IncTransactionDataFromPro() {
|
|
|
"tag_topinformation_ai": 1,
|
|
|
}
|
|
|
arr := [][]map[string]interface{}{}
|
|
|
- it := sess.DB(MgoB.DbName).C("projectset_20230904").Find(&query).Select(&fields).Iter()
|
|
|
+ it := sess.DB(MgoPro.DbName).C("projectset_20230904").Find(&query).Select(&fields).Iter()
|
|
|
n := 0
|
|
|
for tmp := make(map[string]interface{}); it.Next(tmp); n++ {
|
|
|
ch <- true
|
|
@@ -277,19 +277,19 @@ func IncTransactionDataFromPro() {
|
|
|
arr = append(arr, update)
|
|
|
}
|
|
|
if len(arr) > 50 {
|
|
|
- MgoPro.UpSertBulk("projectset_wy", arr...)
|
|
|
+ MgoPro.UpSertBulk("projectset_wy_back", arr...)
|
|
|
arr = [][]map[string]interface{}{}
|
|
|
}
|
|
|
lock.Unlock()
|
|
|
}(tmp)
|
|
|
- if n%100 == 0 {
|
|
|
+ if n%1000 == 0 {
|
|
|
fmt.Println("current:", n)
|
|
|
}
|
|
|
tmp = map[string]interface{}{}
|
|
|
}
|
|
|
wg.Wait()
|
|
|
if len(arr) > 0 {
|
|
|
- MgoPro.UpSertBulk("projectset_wy", arr...)
|
|
|
+ MgoPro.UpSertBulk("projectset_wy_back", arr...)
|
|
|
arr = [][]map[string]interface{}{}
|
|
|
}
|
|
|
fmt.Println("执行增量项目信息完毕", ProStartTime, endTime)
|