feat: 添加订单超时自动取消与 SMS 告警任务
All checks were successful
Build and Deploy TenantApi + SkuWorker / build-and-deploy (push) Successful in 1m50s
All checks were successful
Build and Deploy TenantApi + SkuWorker / build-and-deploy (push) Successful in 1m50s
- OrderTimeoutJob 替换占位实现为真实逻辑(查询超时订单 → 批量取消 → 发布事件) - 新增 OrderEscalationJob(每 2 分钟检查超时未接单订单,预留 SMS 告警) - 新增 OrderTimeoutOptions(AutoCancelMinutes=15, SmsEscalationMinutes=10) - RecurringJobRegistrar 注册 OrderEscalationJob - SchedulerServiceCollectionExtensions 注册 Job + Options
This commit is contained in:
@@ -37,6 +37,11 @@ public static class SchedulerServiceCollectionExtensions
|
||||
.ValidateDataAnnotations()
|
||||
.ValidateOnStart();
|
||||
|
||||
services.AddOptions<OrderTimeoutOptions>()
|
||||
.Bind(configuration.GetSection("Scheduler:OrderTimeout"))
|
||||
.ValidateDataAnnotations()
|
||||
.ValidateOnStart();
|
||||
|
||||
services.AddHangfire((serviceProvider, config) =>
|
||||
{
|
||||
var options = serviceProvider.GetRequiredService<IOptionsMonitor<SchedulerOptions>>().CurrentValue;
|
||||
@@ -59,6 +64,7 @@ public static class SchedulerServiceCollectionExtensions
|
||||
services.AddHostedService<RecurringJobHostedService>();
|
||||
|
||||
services.AddScoped<OrderTimeoutJob>();
|
||||
services.AddScoped<OrderEscalationJob>();
|
||||
services.AddScoped<CouponExpireJob>();
|
||||
services.AddScoped<LogCleanupJob>();
|
||||
services.AddScoped<SubscriptionRenewalReminderJob>();
|
||||
|
||||
Reference in New Issue
Block a user