fix:推送逻辑变更

This commit is contained in:
李鹏军 2024-04-01 18:14:02 +08:00
parent b0f61447ca
commit 232d7d8254
2 changed files with 6 additions and 4 deletions

View File

@ -33,8 +33,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(ErrorCode, $"检测到重复消费,消费参数:{argumentJsonStr}"); // throw new BusinessException(ErrorCode, $"检测到重复消费,消费参数:{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内不允许一模一样的参数重复消费

View File

@ -48,8 +48,6 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
var log = new TrackPushRecordIndex var log = new TrackPushRecordIndex
{ {
IndexName = $"{GlobalConst.TrackPushRecordsIndex}-{DateTime.Now:yyyy.MM.dd}", IndexName = $"{GlobalConst.TrackPushRecordsIndex}-{DateTime.Now:yyyy.MM.dd}",
RequestId = res.RequestId,
Message = res.Msg,
OptionType = @event.OptionType.ToString(), OptionType = @event.OptionType.ToString(),
OrderId = @event.OrderId, OrderId = @event.OrderId,
TrackStatus = @event.TrackStatus, TrackStatus = @event.TrackStatus,
@ -183,6 +181,8 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
log.PushContent = body.ToJson(); log.PushContent = body.ToJson();
log.IsSuccess = res.Code == InterfaceRelayConst.SuccessCode; log.IsSuccess = res.Code == InterfaceRelayConst.SuccessCode;
log.RequestId = res.RequestId;
log.Message = res.Msg;
} }
private async Task DoUpdateAsync(TrackPushEvent @event, private async Task DoUpdateAsync(TrackPushEvent @event,
@ -215,5 +215,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
log.PushContent = data.ToJson(); log.PushContent = data.ToJson();
log.IsSuccess = res.Code == InterfaceRelayConst.SuccessCode; log.IsSuccess = res.Code == InterfaceRelayConst.SuccessCode;
log.RequestId = res.RequestId;
log.Message = res.Msg;
} }
} }