|
|
@@ -15,10 +15,15 @@ import ( |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
func DataCollectCronHaodankuRealNews() { |
|
|
|
func DataCollectCronHaodankuRealNews(types int) { |
|
|
|
key := md.ZhiosRealNewsData |
|
|
|
//es.CreateIndexIfNotExists(key, md.ZhiosRealNewsDataField) |
|
|
|
ids := []int{10001, 10002, 10003, 10004} |
|
|
|
num := 10 |
|
|
|
if types == 0 { |
|
|
|
ids = []int{0} |
|
|
|
num = 3 |
|
|
|
} |
|
|
|
size := 100 |
|
|
|
now := time.Now() |
|
|
|
fmt.Println("============", time.Since(now)) |
|
|
@@ -27,7 +32,7 @@ func DataCollectCronHaodankuRealNews() { |
|
|
|
third_zm_app_key := sysCfgDb.SysCfgGetOneData("third_zm_app_key") |
|
|
|
third_zm_app_secret := sysCfgDb.SysCfgGetOneData("third_zm_app_secret") |
|
|
|
for _, v := range ids { |
|
|
|
for i := 1; i <= 10; i++ { |
|
|
|
for i := 1; i <= num; i++ { |
|
|
|
tianMaoChaoZhiData, err := haodanku.HaodankuRealTime(utils.IntToStr(v), utils.IntToStr(i), utils.IntToStr(size), "") |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|