|
@@ -24,6 +24,8 @@ import (
|
|
|
. "bp.jydev.jianyu360.cn/BaseService/pushpkg/recommend"
|
|
|
)
|
|
|
|
|
|
+const tenDaySecond = 864000
|
|
|
+
|
|
|
type NoMsgTipJob struct {
|
|
|
selectPool chan bool
|
|
|
savePool chan bool
|
|
@@ -100,6 +102,9 @@ func (n *NoMsgTipJob) Execute(taskType int) {
|
|
|
})
|
|
|
var noMsgTipLastId atomic.Value
|
|
|
wxTplSurplus := WxNoMsgTmplUsableNum(Mgo_Log, Config.NoMsgTip.WxNodeNum, Config.NoMsgTip.DayNum, Config.NoMsgTip.Count, Config.NoMsgTip.Retain)
|
|
|
+ if wxTplSurplus > Config.NoMsgTip.UsableNum && Config.NoMsgTip.UsableNum > 0 {
|
|
|
+ wxTplSurplus = Config.NoMsgTip.UsableNum
|
|
|
+ }
|
|
|
if Config.NoMsgTip.IsRecommendNewest {
|
|
|
VarRecommend.SetNewest(1)
|
|
|
}
|
|
@@ -129,10 +134,10 @@ func (n *NoMsgTipJob) isTip(taskType int, user *UserInfo) bool {
|
|
|
}
|
|
|
now := time.Now()
|
|
|
if prevTipUnix, err := redis.GetNewInt(Pushcache_2_c, PrevNoMsgTipKey(user.Id)); err != nil {
|
|
|
- logger.Error("无消息提醒任务", taskType, "redis判断三天前是否提醒过出错", err)
|
|
|
+ logger.Error("无消息提醒任务", taskType, "redis判断十天内是否提醒过出错", err)
|
|
|
return false
|
|
|
- } else if now.Unix() < int64(prevTipUnix+ThreeDay) {
|
|
|
- logger.Info("无消息提醒任务", taskType, "三天内已经提醒过,过滤掉", user.Id)
|
|
|
+ } else if now.Unix() < int64(prevTipUnix+tenDaySecond) {
|
|
|
+ logger.Info("无消息提醒任务", taskType, "十天内已经提醒过,过滤掉", user.Id)
|
|
|
return false
|
|
|
}
|
|
|
return true
|
|
@@ -171,7 +176,7 @@ func (n *NoMsgTipJob) toTip(taskType int, user *UserInfo, wxTplSurplus int64, no
|
|
|
}
|
|
|
now := time.Now()
|
|
|
redis.Put(Pushcache_2_c, NoMsgTipKey(user.Id), 1, OneDaySecond)
|
|
|
- redis.Put(Pushcache_2_c, PrevNoMsgTipKey(user.Id), time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix(), ThreeDay+OneDaySecond)
|
|
|
+ redis.Put(Pushcache_2_c, PrevNoMsgTipKey(user.Id), time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix(), tenDaySecond+OneDaySecond)
|
|
|
start := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
|
|
|
startEndMd := fmt.Sprintf("%d月%d日", start.Month(), start.Day())
|
|
|
logger.Info("无消息提醒任务", taskType, "开始推送", user.Id, "rateMode", user.PushSet.SubSet.RateMode, "jpushid", user.Jpushid, "opushid", user.Opushid, "appponetype", user.AppPhoneType, "email", user.PushSet.Email)
|