change:推送重试重入队列+失败日志
This commit is contained in:
parent
71ec9f09cc
commit
2e551b21d7
@ -105,22 +105,20 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
// 往es 写推送日志
|
||||
await _trackPushRecordsRepository.AddAsync(log);
|
||||
|
||||
if (!log.IsSuccess)
|
||||
{
|
||||
// 重试过程中不会去更新订单主表
|
||||
if (@event.RetryNum < 3)
|
||||
{
|
||||
@event.RetryNum++;
|
||||
// 1, 2, 4min
|
||||
await _capPublisher.PublishDelayAsync(
|
||||
TimeSpan.FromSeconds((1 << @event.RetryNum - 1) * RandomHelper.GetRandom(30, 60)),
|
||||
GlobalConst.TrackPushSubscribe, @event);
|
||||
await _capPublisher.PublishAsync(GlobalConst.TrackPushSubscribe, @event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 往es 写推送日志
|
||||
await _trackPushRecordsRepository.AddAsync(log);
|
||||
|
||||
// 同步去更新订单主表
|
||||
await TrackPushAfterUpdateOrderAsync(new TrackPushAfterUpdateOrderDto
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user