|
@@ -90,7 +90,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
|
|
// 查推送
|
|
// 查推送
|
|
subscribeTime := time.Now()
|
|
subscribeTime := time.Now()
|
|
list = roleNewestInfo.GetPushHistory()
|
|
list = roleNewestInfo.GetPushHistory()
|
|
- log.Println("获取订阅数据耗时:", time.Since(subscribeTime).Seconds())
|
|
|
|
|
|
+ log.Println(in.PositionId, "---获取订阅数据耗时:", time.Since(subscribeTime).Seconds())
|
|
if list != nil && len(list) > 0 {
|
|
if list != nil && len(list) > 0 {
|
|
res.Data.List = list
|
|
res.Data.List = list
|
|
res.Data.Count = int64(len(list))
|
|
res.Data.Count = int64(len(list))
|
|
@@ -111,7 +111,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
|
|
}
|
|
}
|
|
esTime := time.Now()
|
|
esTime := time.Now()
|
|
list = model.NewestES(query)
|
|
list = model.NewestES(query)
|
|
- log.Println("获取es数据耗时:", time.Since(esTime).Seconds())
|
|
|
|
|
|
+ log.Println(in.PositionId, "---获取es数据耗时:", time.Since(esTime).Seconds())
|
|
res.Data.List = list
|
|
res.Data.List = list
|
|
res.Data.Count = int64(len(list))
|
|
res.Data.Count = int64(len(list))
|
|
return res, &newSet{model.StatusLogin, redisKey, model.StatusLogin, query}
|
|
return res, &newSet{model.StatusLogin, redisKey, model.StatusLogin, query}
|
|
@@ -135,7 +135,9 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
|
|
go func(n *newSet, in *bxbase.NewestBiddingReq) {
|
|
go func(n *newSet, in *bxbase.NewestBiddingReq) {
|
|
if n.redisKey != "" {
|
|
if n.redisKey != "" {
|
|
//剩余时间 在 IC.C.NewsTimeOut 之内
|
|
//剩余时间 在 IC.C.NewsTimeOut 之内
|
|
- if ttl := redis.GetTTL("new", n.redisKey); ttl-IC.C.NewsTimeOut < 0 {
|
|
|
|
|
|
+ ttl := redis.GetTTL("new", n.redisKey)
|
|
|
|
+ log.Println(in.PositionId, "---缓存剩余时间:", ttl)
|
|
|
|
+ if ttl-IC.C.NewsTimeOut < 0 {
|
|
var res = &bxbase.NewsetBiddingResp{
|
|
var res = &bxbase.NewsetBiddingResp{
|
|
Data: &bxbase.NewsetBidding{
|
|
Data: &bxbase.NewsetBidding{
|
|
List: []*bxbase.NewestList{},
|
|
List: []*bxbase.NewestList{},
|
|
@@ -157,6 +159,6 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
|
|
}
|
|
}
|
|
|
|
|
|
model.MakeCollection(in.UserId, r.Data.List)
|
|
model.MakeCollection(in.UserId, r.Data.List)
|
|
- log.Println("接口耗时:", time.Since(t).Seconds())
|
|
|
|
|
|
+ log.Println(in.PositionId, "--接口耗时:", time.Since(t).Seconds())
|
|
return r, nil
|
|
return r, nil
|
|
}
|
|
}
|