feat: 支持默认启用redis

This commit is contained in:
橙子
2025-03-18 23:13:16 +08:00
parent f7d9effa07
commit 710ad95eda
3 changed files with 16 additions and 11 deletions

View File

@@ -185,12 +185,12 @@ namespace Yi.Abp.Application.Services
/// <summary>
/// 分布式送abp版本abp套了一层娃。但是纯粹鸡肋不建议使用这个
/// </summary>
public IAbpDistributedLock AbpDistributedLock { get; set; }
public IAbpDistributedLock AbpDistributedLock => LazyServiceProvider.LazyGetService<IAbpDistributedLock>();
/// <summary>
/// 分布式锁推荐使用版本yyds分布式锁永远的神
/// </summary>
public IDistributedLockProvider DistributedLock { get; set; }
public IDistributedLockProvider DistributedLock => LazyServiceProvider.LazyGetService<IDistributedLockProvider>();
/// <summary>
/// 分布式锁

View File

@@ -204,7 +204,7 @@ namespace Yi.Abp.Web
var redisConfiguration = configuration["Redis:Configuration"];
context.Services.AddHangfire(config=>
{
bool.TryParse( configuration["Redis:IsEnabled"], out var redisEnabled);
var redisEnabled=configuration.GetSection("Redis").GetValue<bool>("IsEnabled");
if (redisEnabled)
{
var jobDb=configuration.GetSection("Redis").GetValue<int>("JobDb");