From 1702aa76543231a04b88cde3f973cd111243a42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=BE=99=20=E7=8E=8B?= Date: Thu, 12 Dec 2024 11:11:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DCAP=E5=B9=82=E7=AD=89?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=97=B6=E6=95=88=E8=BF=87=E9=95=BF=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E9=87=8D=E8=AF=95=E5=8F=82=E6=95=B0=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=BF=87=E5=BF=AB=E8=80=8C=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E7=8E=B0=E5=B0=86=E6=97=B6=E6=95=88=E8=B0=83=E6=95=B4=E8=87=B3?= =?UTF-8?q?1s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Application/CAP/CAPFilter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application/CAP/CAPFilter.cs b/src/SJZY.Track.Application/CAP/CAPFilter.cs index 35fa9f23..0decb640 100644 --- a/src/SJZY.Track.Application/CAP/CAPFilter.cs +++ b/src/SJZY.Track.Application/CAP/CAPFilter.cs @@ -29,7 +29,7 @@ public class CapFilter : SubscribeFilter context.DeliverMessage.Headers["sjzy-arguments-hash"] = hash; } - if (await RedisHelper.Client.ExistsAsync($"CapExecuteFilter:{hash}")) + if (await RedisHelper.Client.ExistsAsync($"CapExecuteFilter:{hash}{DateTime.Now:G}")) { throw new BusinessException(GlobalConst.CapNoRetryErrorCode, $"检测到重复消费,消费参数:{argumentJsonStr}"); } @@ -41,7 +41,7 @@ public class CapFilter : SubscribeFilter context.DeliverMessage.Headers.TryGetValue("sjzy-arguments-hash", out var hash); if (!hash.IsNullOrEmpty()) { - await RedisHelper.Client.SetAsync($"CapExecuteFilter:{hash}", 1, TimeSpan.FromMinutes(3)); + await RedisHelper.Client.SetAsync($"CapExecuteFilter:{hash}{DateTime.Now:G}", 1, TimeSpan.FromMinutes(3)); } }