wangchuanjin 2 ماه پیش
والد
کامیت
47f468b26f
3فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 1 0
      pushsubscribe/push/config.json
  2. 1 0
      pushsubscribe/push/config/config.go
  3. 4 6
      pushsubscribe/push/job/nomsgtipjob.go

+ 1 - 0
pushsubscribe/push/config.json

@@ -82,6 +82,7 @@
 		"count":1000000,
 		"count":1000000,
 		"retain":100000,
 		"retain":100000,
 		"usableNum":8000,
 		"usableNum":8000,
+		"interval": 432000,
 		"wx":{
 		"wx":{
 			"id":"ahEQafQBYZX8cVYXko-XaU1QkJ8MHiR-O9UNv_BRMzk",
 			"id":"ahEQafQBYZX8cVYXko-XaU1QkJ8MHiR-O9UNv_BRMzk",
 			"url":"/jy_mobile/tabbar/recommendedlist",
 			"url":"/jy_mobile/tabbar/recommendedlist",

+ 1 - 0
pushsubscribe/push/config/config.go

@@ -63,6 +63,7 @@ type config struct {
 		Count               int64 `json:"count"`
 		Count               int64 `json:"count"`
 		Retain              int64 `json:"retain"`
 		Retain              int64 `json:"retain"`
 		UsableNum           int64 `json:"usableNum"`
 		UsableNum           int64 `json:"usableNum"`
+		Interval            int   `json:"interval"`
 		Wx                  struct {
 		Wx                  struct {
 			Id        string
 			Id        string
 			Url       string
 			Url       string

+ 4 - 6
pushsubscribe/push/job/nomsgtipjob.go

@@ -24,8 +24,6 @@ import (
 	. "bp.jydev.jianyu360.cn/BaseService/pushpkg/recommend"
 	. "bp.jydev.jianyu360.cn/BaseService/pushpkg/recommend"
 )
 )
 
 
-const tenDaySecond = 864000
-
 type NoMsgTipJob struct {
 type NoMsgTipJob struct {
 	selectPool chan bool
 	selectPool chan bool
 	savePool   chan bool
 	savePool   chan bool
@@ -134,10 +132,10 @@ func (n *NoMsgTipJob) isTip(taskType int, user *UserInfo) bool {
 	}
 	}
 	now := time.Now()
 	now := time.Now()
 	if prevTipUnix, err := redis.GetNewInt(Pushcache_2_c, PrevNoMsgTipKey(user.Id)); err != nil {
 	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
 		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 false
 	}
 	}
 	return true
 	return true
@@ -176,7 +174,7 @@ func (n *NoMsgTipJob) toTip(taskType int, user *UserInfo, wxTplSurplus int64, no
 	}
 	}
 	now := time.Now()
 	now := time.Now()
 	redis.Put(Pushcache_2_c, NoMsgTipKey(user.Id), 1, OneDaySecond)
 	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)
 	start := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
 	startEndMd := fmt.Sprintf("%d月%d日", start.Month(), start.Day())
 	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)
 	logger.Info("无消息提醒任务", taskType, "开始推送", user.Id, "rateMode", user.PushSet.SubSet.RateMode, "jpushid", user.Jpushid, "opushid", user.Opushid, "appponetype", user.AppPhoneType, "email", user.PushSet.Email)