|
@@ -80,11 +80,11 @@ func (p *ProjectPushJob) Execute() {
|
|
|
if !ok {
|
|
|
return
|
|
|
}
|
|
|
- topTypes, _ := list[i]["toptypes"].([]interface{})
|
|
|
+ subtypes, _ := list[i]["subtypes"].([]interface{})
|
|
|
maxId, _ := list[i]["maxid"].(string)
|
|
|
- userTopType := map[string]bool{}
|
|
|
- for _, t := range topTypes {
|
|
|
- userTopType[util.ObjToString(t)] = true
|
|
|
+ userSubtype := map[string]bool{}
|
|
|
+ for _, t := range subtypes {
|
|
|
+ userSubtype[util.ObjToString(t)] = true
|
|
|
}
|
|
|
//
|
|
|
project, _ := pi.(map[string]interface{})
|
|
@@ -100,8 +100,8 @@ func (p *ProjectPushJob) Execute() {
|
|
|
if unix-publishtime > Config.ProjectPublishTimeLimit { //发布时间7天之内
|
|
|
continue
|
|
|
}
|
|
|
- topType, _ := plm["toptype"].(string)
|
|
|
- if len(userTopType) > 0 && !userTopType[topType] {
|
|
|
+ subtype, _ := plm["subtype"].(string)
|
|
|
+ if len(userSubtype) > 0 && !userSubtype[subtype] {
|
|
|
continue
|
|
|
}
|
|
|
isExists, err := redis.Exists(Pushcache_2_a, PushInfoKey(userId, infoId))
|
|
@@ -140,7 +140,7 @@ func (p *ProjectPushJob) Execute() {
|
|
|
}
|
|
|
}
|
|
|
if len(updateProject) > 0 {
|
|
|
- mongodb.NewUpdateBulk(Pushspace_project, updateProject...)
|
|
|
+ mongodb.NewUpdateBulk(Pushspace_project, true, true, updateProject...)
|
|
|
}
|
|
|
if len(updateProject) < BigBulkSize {
|
|
|
break
|
|
@@ -220,7 +220,7 @@ func (p *ProjectPushJob) loadPushspace_project(batchIndex int, startId *string)
|
|
|
it := sess.DB(DbName).C(Pushspace_project).Find(query).Select(map[string]interface{}{
|
|
|
"_id": 1,
|
|
|
"maxid": 1,
|
|
|
- "toptypes": 1,
|
|
|
+ "subtypes": 1,
|
|
|
"userid": 1,
|
|
|
"projectid": 1,
|
|
|
}).Sort("-_id", "userid").Iter()
|