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