fix:修复矿池刷新数量
This commit is contained in:
@@ -34,6 +34,7 @@ public class AutoRefreshMiningPoolJob : QuartzBackgroundWorkerBase
|
||||
|
||||
public override async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
|
||||
//刷新矿池
|
||||
await _miningPoolManager.RefreshMiningPoolAsync();
|
||||
//刷新用户限制
|
||||
|
||||
@@ -15,9 +15,6 @@ namespace Yi.Abp.Domain.Shared.Settings
|
||||
public override void Define(ISettingDefinitionContext context)
|
||||
{
|
||||
context.Add(
|
||||
//每日矿池最大上限--控制矿池膨胀率
|
||||
new SettingDefinition("MaxPoolLimit", "100"),
|
||||
|
||||
//每日挖矿最大上限--控制无限挖矿
|
||||
new SettingDefinition("MiningMaxLimit", "36"),
|
||||
|
||||
@@ -31,7 +28,7 @@ namespace Yi.Abp.Domain.Shared.Settings
|
||||
new SettingDefinition("MarketTaxRate", "0.02"),
|
||||
|
||||
//矿池刷新内容
|
||||
new SettingDefinition("PoolData", "60,24,10,3,1")
|
||||
new SettingDefinition("PoolData", "60,26,10,3,1")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using FreeRedis;
|
||||
using Microsoft.Extensions.Caching.Distributed;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Volo.Abp.Caching;
|
||||
using Volo.Abp.Domain.Services;
|
||||
using Volo.Abp.EventBus.Local;
|
||||
@@ -333,7 +334,7 @@ public class MiningPoolManager : DomainService
|
||||
public async Task RefreshMiningPoolAsync()
|
||||
{
|
||||
//获取当前最大的限制
|
||||
var maximumPoolLimit = int.Parse(await _settingProvider.GetOrNullAsync("MaxPoolLimit"));
|
||||
// var maximumPoolLimit = int.Parse(await _settingProvider.GetOrNullAsync("MaxPoolLimit"));
|
||||
var poolData = (await _settingProvider.GetOrNullAsync("PoolData")).Split(',').Select(x=>int.Parse(x)).ToList();
|
||||
DateTime startTime = DateTime.Today.AddHours(10);
|
||||
DateTime endTime = startTime.AddDays(1);
|
||||
@@ -362,12 +363,18 @@ public class MiningPoolManager : DomainService
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存前缀
|
||||
/// </summary>
|
||||
private string CacheKeyPrefix => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpDistributedCacheOptions>>()
|
||||
.Value.KeyPrefix;
|
||||
/// <summary>
|
||||
/// 刷新用户挖矿限制
|
||||
/// </summary>
|
||||
public async Task RefreshMiningUserLimitAsync()
|
||||
{
|
||||
await RedisClient.DelAsync($"{MiningCacheConst.UserMiningLimit}*");
|
||||
|
||||
await RedisClient.DelAsync($"{CacheKeyPrefix}{MiningCacheConst.UserMiningLimit}*");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user