|
|
|
@ -1,7 +1,5 @@ |
|
|
|
using EShopOnAbp.AdministrationService.EntityFrameworkCore; |
|
|
|
using EShopOnAbp.Shared.Hosting.AspNetCore; |
|
|
|
using Medallion.Threading; |
|
|
|
using Medallion.Threading.Redis; |
|
|
|
using Microsoft.AspNetCore.DataProtection; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using StackExchange.Redis; |
|
|
|
@ -9,6 +7,7 @@ using Volo.Abp.AspNetCore.MultiTenancy; |
|
|
|
using Volo.Abp.BackgroundJobs.RabbitMQ; |
|
|
|
using Volo.Abp.Caching; |
|
|
|
using Volo.Abp.Caching.StackExchangeRedis; |
|
|
|
using Volo.Abp.DistributedLocking; |
|
|
|
using Volo.Abp.EventBus.RabbitMq; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.MultiTenancy; |
|
|
|
@ -21,7 +20,8 @@ namespace EShopOnAbp.Shared.Hosting.Microservices; |
|
|
|
typeof(AbpAspNetCoreMultiTenancyModule), |
|
|
|
typeof(AbpEventBusRabbitMqModule), |
|
|
|
typeof(AbpCachingStackExchangeRedisModule), |
|
|
|
typeof(AdministrationServiceEntityFrameworkCoreModule) |
|
|
|
typeof(AdministrationServiceEntityFrameworkCoreModule), |
|
|
|
typeof(AbpDistributedLockingAbstractionsModule) |
|
|
|
)] |
|
|
|
public class EShopOnAbpSharedHostingMicroservicesModule : AbpModule |
|
|
|
{ |
|
|
|
@ -43,12 +43,5 @@ public class EShopOnAbpSharedHostingMicroservicesModule : AbpModule |
|
|
|
context.Services |
|
|
|
.AddDataProtection() |
|
|
|
.PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys"); |
|
|
|
|
|
|
|
|
|
|
|
context.Services.AddSingleton<IDistributedLockProvider>(sp => |
|
|
|
{ |
|
|
|
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); |
|
|
|
return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |