|
@@ -24,8 +24,6 @@ import (
|
|
|
. "bp.jydev.jianyu360.cn/BaseService/pushpkg/recommend"
|
|
|
)
|
|
|
|
|
|
-const tenDaySecond = 864000
|
|
|
-
|
|
|
type NoMsgTipJob struct {
|
|
|
selectPool chan bool
|
|
|
savePool chan bool
|
|
@@ -134,10 +132,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判断n天内是否提醒过出错", err)
|
|
|
return false
|
|
|
- } else if now.Unix() < int64(prevTipUnix+tenDaySecond) {
|
|
|
- logger.Info("无消息提醒任务", taskType, "十天内已经提醒过,过滤掉", user.Id)
|
|
|
+ } else if now.Unix() < int64(prevTipUnix+Config.NoMsgTip.Interval) {
|
|
|
+ logger.Info("无消息提醒任务", taskType, "n天内已经提醒过,过滤掉", user.Id)
|
|
|
return false
|
|
|
}
|
|
|
return true
|
|
@@ -176,7 +174,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(), tenDaySecond+OneDaySecond)
|
|
|
+ redis.Put(Pushcache_2_c, PrevNoMsgTipKey(user.Id), time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix(), Config.NoMsgTip.Interval+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)
|