♻️ Move the lotteries logic to the wallet service
This commit is contained in:
@@ -40,8 +40,16 @@ public static class ScheduledJobsConfiguration
|
||||
.WithSimpleSchedule(o => o
|
||||
.WithIntervalInHours(1)
|
||||
.RepeatForever())
|
||||
|
||||
);
|
||||
|
||||
q.AddJob<Lotteries.LotteryDrawJob>(opts => opts.WithIdentity("LotteryDraw"));
|
||||
q.AddTrigger(opts => opts
|
||||
.ForJob("LotteryDraw")
|
||||
.WithIdentity("LotteryDrawTrigger")
|
||||
.WithCronSchedule("0 0 0 * * ?"));
|
||||
});
|
||||
|
||||
services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
|
||||
|
||||
return services;
|
||||
|
||||
@@ -10,6 +10,7 @@ using DysonNetwork.Shared.Registry;
|
||||
using DysonNetwork.Wallet.Localization;
|
||||
using DysonNetwork.Wallet.Payment;
|
||||
using DysonNetwork.Wallet.Payment.PaymentHandlers;
|
||||
using DysonNetwork.Wallet.Lotteries;
|
||||
|
||||
namespace DysonNetwork.Wallet.Startup;
|
||||
|
||||
@@ -101,6 +102,7 @@ public static class ServiceCollectionExtensions
|
||||
services.AddScoped<PaymentService>();
|
||||
services.AddScoped<SubscriptionService>();
|
||||
services.AddScoped<AfdianPaymentHandler>();
|
||||
services.AddScoped<LotteryService>();
|
||||
|
||||
services.AddHostedService<BroadcastEventHandler>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user