Browse Source

fix:推送私信限制修改修改

duxin 1 year ago
parent
commit
528e4e5664
1 changed files with 5 additions and 7 deletions
  1. 5 7
      rpc/internal/common/appPush.go

+ 5 - 7
rpc/internal/common/appPush.go

@@ -4,9 +4,7 @@ import (
 	"app.yhyue.com/moapp/MessageCenter/rpc/internal/config"
 	qutil "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/mongodb"
-	"app.yhyue.com/moapp/jybase/redis"
 	"errors"
-	"fmt"
 	"k8s.io/apimachinery/pkg/util/json"
 	"log"
 	"net/rpc"
@@ -16,10 +14,10 @@ func AppPushMsg(userInfo map[string]interface{}, stm, appPushUrl, title, detail
 	//限制
 	//校验发送间隔
 	userId := mongodb.BsonIdToSId(userInfo["_id"])
-	userKey := fmt.Sprintf("appPush_letter_%s", userId)
-	if sendWait, _ := redis.Exists(CacheDb, userKey); sendWait {
-		return fmt.Errorf("发送模版消息频繁,稍后重试")
-	}
+	//userKey := fmt.Sprintf("appPush_letter_%s", userId)
+	//if sendWait, _ := redis.Exists(CacheDb, userKey); sendWait {
+	//	return fmt.Errorf("发送模版消息频繁,稍后重试")
+	//}
 	if pushSetMap := qutil.ObjToMap(userInfo["o_pushset"]); pushSetMap != nil && len(*pushSetMap) > 0 {
 		if pushKeyMap := qutil.ObjToMap((*pushSetMap)[stm]); pushKeyMap != nil && len(*pushKeyMap) > 0 {
 			if qutil.Int64All((*pushKeyMap)["i_apppush"]) == 1 {
@@ -46,7 +44,7 @@ func AppPushMsg(userInfo map[string]interface{}, stm, appPushUrl, title, detail
 					if err := AppGrpcPush(dt, otherPushId, jgPushId, phoneType, appPushUrl); err != nil {
 						return err
 					}
-					redis.Put(CacheDb, userKey, 1, config.ConfigJson.WxTmplConfig.Limit.DuringMine*60)
+					//redis.Put(CacheDb, userKey, 1, config.ConfigJson.WxTmplConfig.Limit.DuringMine*60)
 				}
 			}
 		}