|
@@ -30,7 +30,9 @@ func main() {
|
|
|
|
|
|
local, _ := time.LoadLocation("Asia/Shanghai")
|
|
|
c := cron.New(cron.WithLocation(local), cron.WithSeconds())
|
|
|
- eid, err := c.AddFunc(GF.Cron.Spec, dealData)
|
|
|
+ eid, err := c.AddFunc(GF.Cron.Spec, getHot)
|
|
|
+ c.AddFunc(GF.Cron.Spec2, dealData) // 每2小时执行
|
|
|
+
|
|
|
if err != nil {
|
|
|
log.Info("main", zap.Any("AddFunc err", err))
|
|
|
}
|
|
@@ -76,7 +78,7 @@ func dealBidding() {
|
|
|
//默认 取大于 昨天的数据
|
|
|
q = map[string]interface{}{
|
|
|
"comeintime": map[string]interface{}{
|
|
|
- "$gt": time.Date(now.Year(), now.Month(), now.Day()-1, 0, 0, 0, 0, now.Location()).Unix(),
|
|
|
+ "$gt": time.Date(now.Year(), now.Month(), now.Day(), now.Hour()-2, 0, 0, 0, now.Location()).Unix(),
|
|
|
},
|
|
|
}
|
|
|
}
|
|
@@ -152,7 +154,7 @@ func dealBidding() {
|
|
|
}
|
|
|
|
|
|
//处理热门标讯数据/热门项目
|
|
|
- getHot()
|
|
|
+ //getHot()
|
|
|
//dealHotDataAll()
|
|
|
|
|
|
log.Info("dealBidding", zap.Int("over ", count))
|
|
@@ -294,7 +296,7 @@ func dealProject() {
|
|
|
//默认 取大于 昨天的数据
|
|
|
q = map[string]interface{}{
|
|
|
"pici": map[string]interface{}{
|
|
|
- "$gt": time.Date(now.Year(), now.Month(), now.Day()-1, 0, 0, 0, 0, now.Location()).Unix(),
|
|
|
+ "$gt": time.Date(now.Year(), now.Month(), now.Day(), now.Hour()-2, 0, 0, 0, now.Location()).Unix(),
|
|
|
},
|
|
|
}
|
|
|
}
|