From ad563dda97d4c901e89b1934e043a4c92b2ba281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Mon, 15 Apr 2024 19:14:41 +0800 Subject: [PATCH] =?UTF-8?q?opt=EF=BC=9A=E5=88=A0=E4=B8=8D=E5=81=9A?= =?UTF-8?q?=E5=B9=82=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Application/EventHandlers/CAPFilter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SJZY.Track.Application/EventHandlers/CAPFilter.cs b/src/SJZY.Track.Application/EventHandlers/CAPFilter.cs index 06bdeca3..20d168f2 100644 --- a/src/SJZY.Track.Application/EventHandlers/CAPFilter.cs +++ b/src/SJZY.Track.Application/EventHandlers/CAPFilter.cs @@ -20,9 +20,9 @@ public class CapFilter : SubscribeFilter { context.DeliverMessage.Headers["sjzy-receive-time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff"); - // 轨迹增删改要做幂等 + // 轨迹增改要做幂等 if (!context.DeliverMessage.Headers["cap-msg-name"] - .IsIn(GlobalConst.TrackUpsertSubscribe, GlobalConst.TrackDeleteSubscribe)) + .IsIn(GlobalConst.TrackUpsertSubscribe)) return Task.CompletedTask; // 本地调试不做幂等 @@ -44,7 +44,7 @@ public class CapFilter : SubscribeFilter throw new BusinessException(ErrorCode, $"检测到重复消费,消费参数:{argumentJsonStr}"); RedisHelper.Client.Set($"CapExcuteFilter:{hash}", 60 * 10, - TimeSpan.FromHours(1).Seconds); // 1h内不允许一模一样的参数重复消费 + TimeSpan.FromMinutes(5).Seconds); } }