wangchuanjin 7 years ago
parent
commit
904c527920
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/jfw/modules/push/src/qfw/push/dopush/dopushes.go

+ 7 - 7
src/jfw/modules/push/src/qfw/push/dopush/dopushes.go

@@ -375,10 +375,10 @@ func DoPush(a_p *Pjob, s_p *Pjob, MaxPushSize int, Now time.Time, ratemode int)
 					//直接替换
 					if inofsdata == nil || pLength >= MaxPushSize {
 						upSet = &bson.M{"$set": &bson.M{"tmpinfos": &pushArray}}
-					} else { //保留最新的100条
+					} else { //保留最新的50条
 						infos, _ := (*inofsdata)["tmpinfos"].([]interface{})
 						rLength := len(infos)
-						if rLength > 0 && rLength+pLength > MaxPushSize { //保留50条
+						if rLength > 0 && rLength+pLength > MaxPushSize {
 							start := rLength + pLength - MaxPushSize
 							var relationinfoTemp []interface{}
 							if start < rLength {
@@ -455,6 +455,11 @@ func EachAllBidInfo(a_p *Pjob, s_p *Pjob) *map[*push.MemberInterest]*list.List {
 				}
 			}
 			if len(*users) > 0 {
+				province := util.ObjToString(info["area"])
+				info["otitle"] = info["title"]
+				if "A" != province {
+					info["title"] = fmt.Sprintf(PushTitle, province, info["title"])
+				}
 				EachInfoToUser(users, &info, userMap)
 			}
 		}(temp)
@@ -516,11 +521,6 @@ func GetFinalUser(keys, notkeys []string, key_user *map[string]*[]*push.MemberIn
 func EachInfoToUser(users *map[string]*push.MemberInterest, info *map[string]interface{}, userMap *map[*push.MemberInterest]*list.List) {
 	defer userMapLock.Unlock()
 	userMapLock.Lock()
-	province := util.ObjToString((*info)["area"])
-	(*info)["otitle"] = (*info)["title"]
-	if "A" != province {
-		(*info)["title"] = fmt.Sprintf(PushTitle, province, (*info)["title"])
-	}
 	for _, v := range *users {
 		s := (*userMap)[v]
 		if s == nil {