This commit is contained in:
李鹏军 2024-03-27 11:00:11 +08:00
parent 5aa6596a7b
commit e9d304873e

View File

@ -28,8 +28,8 @@ public class CAPFilter : SubscribeFilter
using (RedisHelper.Client.Lock("Filter:" + hash, 10)) using (RedisHelper.Client.Lock("Filter:" + hash, 10))
{ {
var isSkip = !string.IsNullOrEmpty(RedisHelper.Client.Get($"CapExcuteFilter:{hash}")); var isSkip = !string.IsNullOrEmpty(RedisHelper.Client.Get($"CapExcuteFilter:{hash}"));
// if (isSkip) if (isSkip)
// throw new BusinessException(_ERROR_CODE, $"检测到重复消费,消费参数:{argumentJsonStr}"); throw new BusinessException(_ERROR_CODE, $"检测到重复消费,消费参数:{argumentJsonStr}");
RedisHelper.Client.Set($"CapExcuteFilter:{hash}", 60 * 10, RedisHelper.Client.Set($"CapExcuteFilter:{hash}", 60 * 10,
TimeSpan.FromHours(1).Seconds); // 1h内不允许一模一样的参数重复消费 TimeSpan.FromHours(1).Seconds); // 1h内不允许一模一样的参数重复消费