✨ Lotteries
This commit is contained in:
21
DysonNetwork.Pass/Lotteries/LotteryDrawJob.cs
Normal file
21
DysonNetwork.Pass/Lotteries/LotteryDrawJob.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Quartz;
|
||||
|
||||
namespace DysonNetwork.Pass.Lotteries;
|
||||
|
||||
public class LotteryDrawJob(LotteryService lotteryService, ILogger<LotteryDrawJob> logger) : IJob
|
||||
{
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
logger.LogInformation("Starting daily lottery draw...");
|
||||
|
||||
try
|
||||
{
|
||||
await lotteryService.PerformDailyDrawAsync();
|
||||
logger.LogInformation("Daily lottery draw completed successfully.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, "Error occurred during daily lottery draw.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user