fix: 修复依赖注入问题
This commit is contained in:
@@ -11,8 +11,9 @@ public class AutoRefreshMiningPoolJob : QuartzBackgroundWorkerBase
|
||||
{
|
||||
private readonly MiningPoolManager _miningPoolManager;
|
||||
|
||||
public AutoRefreshMiningPoolJob()
|
||||
public AutoRefreshMiningPoolJob(MiningPoolManager miningPoolManager)
|
||||
{
|
||||
_miningPoolManager = miningPoolManager;
|
||||
JobDetail = JobBuilder.Create<AutoRefreshMiningPoolJob>().WithIdentity(nameof(AutoRefreshMiningPoolJob))
|
||||
.Build();
|
||||
|
||||
@@ -20,6 +21,15 @@ public class AutoRefreshMiningPoolJob : QuartzBackgroundWorkerBase
|
||||
Trigger = TriggerBuilder.Create().WithIdentity(nameof(AutoRefreshMiningPoolJob))
|
||||
.WithCronSchedule("0 0 10 * * ?")
|
||||
.Build();
|
||||
|
||||
|
||||
// Trigger = TriggerBuilder.Create().WithIdentity(nameof(AutoRefreshMiningPoolJob))
|
||||
// .WithSimpleSchedule((schedule) =>
|
||||
// {
|
||||
// schedule.WithInterval(TimeSpan.FromHours(1));
|
||||
// })
|
||||
// .StartNow()
|
||||
// .Build();
|
||||
}
|
||||
|
||||
public override async Task Execute(IJobExecutionContext context)
|
||||
|
||||
@@ -15,6 +15,11 @@ public class MiningPoolService : ApplicationService
|
||||
{
|
||||
private readonly MiningPoolManager _manager;
|
||||
|
||||
public MiningPoolService(MiningPoolManager manager)
|
||||
{
|
||||
_manager = manager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内测-白嫖-获取自动挖矿卡
|
||||
/// </summary>
|
||||
@@ -29,10 +34,10 @@ public class MiningPoolService : ApplicationService
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("mining-pool")]
|
||||
public async Task<MiningPoolGetOutput> GetMiningPoolContentAsync()
|
||||
public async Task<MiningPoolGetOutput?> GetMiningPoolContentAsync()
|
||||
{
|
||||
var content = await _manager.GetMiningPoolContentAsync();
|
||||
var output = content.Adapt<MiningPoolGetOutput>();
|
||||
var output = content.Adapt<MiningPoolGetOutput?>();
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class MiningPoolManager : DomainService
|
||||
return await ComputeMiningProbabilityAsync();
|
||||
});
|
||||
|
||||
public async Task<MiningPoolContent> GetMiningPoolContentAsync()
|
||||
public async Task<MiningPoolContent?> GetMiningPoolContentAsync()
|
||||
{
|
||||
var pool = await _miningPoolCache.GetAsync(MiningCacheConst.MiningPoolContent);
|
||||
return pool;
|
||||
|
||||
Reference in New Issue
Block a user