|
@@ -3,7 +3,6 @@ package main
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
- "github.com/robfig/cron/v3"
|
|
|
"github.com/spf13/viper"
|
|
|
"go.uber.org/zap"
|
|
|
util "jygit.jydev.jianyu360.cn/data_processing/common_utils"
|
|
@@ -147,17 +146,22 @@ func main() {
|
|
|
|
|
|
//dealInc()
|
|
|
|
|
|
- //dealTopInformationAi7(nil)
|
|
|
-
|
|
|
- local, _ := time.LoadLocation("Asia/Shanghai")
|
|
|
- c := cron.New(cron.WithLocation(local), cron.WithSeconds())
|
|
|
- _, err := c.AddFunc(GF.Env.Spec, dealInc)
|
|
|
- if err != nil {
|
|
|
- log.Println("AddFunc err", err)
|
|
|
+ where := map[string]interface{}{
|
|
|
+ "_id": map[string]interface{}{
|
|
|
+ "$lt": mongodb.StringTOBsonId("6715b7e8b25c3e1debabb8eb"),
|
|
|
+ },
|
|
|
}
|
|
|
+ dealTopInformationAi7(where)
|
|
|
|
|
|
- c.Start()
|
|
|
- defer c.Stop()
|
|
|
+ //local, _ := time.LoadLocation("Asia/Shanghai")
|
|
|
+ //c := cron.New(cron.WithLocation(local), cron.WithSeconds())
|
|
|
+ //_, err := c.AddFunc(GF.Env.Spec, dealInc)
|
|
|
+ //if err != nil {
|
|
|
+ // log.Println("AddFunc err", err)
|
|
|
+ //}
|
|
|
+ //
|
|
|
+ //c.Start()
|
|
|
+ //defer c.Stop()
|
|
|
////
|
|
|
select {}
|
|
|
}
|
|
@@ -745,7 +749,7 @@ func dealTopInformationAi7(where interface{}) {
|
|
|
sess := Mgo.GetMgoConn()
|
|
|
defer Mgo.DestoryMongoConn(sess)
|
|
|
count := 0
|
|
|
- ch := make(chan bool, 50)
|
|
|
+ ch := make(chan bool, 100)
|
|
|
wg := &sync.WaitGroup{}
|
|
|
var lines = make([]interface{}, 0)
|
|
|
it := sess.DB(GF.Mongo.DB).C(GF.Mongo.Coll).Find(where).Select(nil).Sort("-_id").Iter()
|