Merge branch 'S02-轨迹中台第二部分' into test

This commit is contained in:
dingenwen 2024-03-26 11:36:37 +08:00
commit 77ceef7614
3 changed files with 3 additions and 1 deletions

View File

@ -32,7 +32,7 @@ public class CAPFilter : SubscribeFilter
throw new BusinessException(_ERROR_CODE, $"检测到重复消费,消费参数:{argumentJsonStr}");
RedisHelper.Client.Set($"CapExcuteFilter:{hash}", 60 * 10,
TimeSpan.FromDays(1).Seconds); // 1天内不允许一模一样的参数重复消费
TimeSpan.FromHours(1).Seconds); // 1h内不允许一模一样的参数重复消费
}
}

View File

@ -104,6 +104,7 @@ public class TrackPullService : ApplicationService
group.Key.SubSystemId, group.Key.OrderType)));
}
if (config.PullInterval < 60) config.PullInterval = 60;
await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count);
}

View File

@ -62,6 +62,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
return await Context.Queryable<TrackPushConfigEntity>()
.LeftJoin<OrderEntity>((a, b) => a.SubSystemId == b.SubSystemId && a.CustomId == b.CustomId)
.Where((a, b) => !b.IsCompleted && b.QuestionType != errorType)
.Where("a.CreateTime < DATE_SUB(now(),INTERVAL 12 hour)") // 过滤掉创建时间不足12小时的
.Select((a, b) => new OrderEntity
{
Id = b.Id,