diff --git a/shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/EfCore/PendingEfCoreMigrationsChecker.cs b/shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/EfCore/PendingEfCoreMigrationsChecker.cs index 15e01e67..f43f3aee 100644 --- a/shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/EfCore/PendingEfCoreMigrationsChecker.cs +++ b/shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/EfCore/PendingEfCoreMigrationsChecker.cs @@ -49,7 +49,6 @@ public abstract class PendingEfCoreMigrationsChecker : PendingMigrat await using (var handle = await DistributedLockProvider.TryAcquireAsync("Migration_" + DatabaseName)) { Log.Information($"Lock is acquired for db migration and seeding on database named: {DatabaseName}..."); - using (CurrentTenant.Change(null)) { // Create database tables if needed @@ -72,6 +71,7 @@ public abstract class PendingEfCoreMigrationsChecker : PendingMigrat await ServiceProvider.GetRequiredService() .SeedAsync(); } + Log.Information($"Lock is released for db migration and seeding on database named: {DatabaseName}..."); } } } \ No newline at end of file diff --git a/shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj b/shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj index 948da22e..5dacf9d2 100644 --- a/shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj +++ b/shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj @@ -9,10 +9,8 @@ - - diff --git a/shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbpSharedHostingMicroservicesModule.cs b/shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbpSharedHostingMicroservicesModule.cs index ad58eef3..07f49478 100644 --- a/shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbpSharedHostingMicroservicesModule.cs +++ b/shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbpSharedHostingMicroservicesModule.cs @@ -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(sp => - { - var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); - return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); - }); } } \ No newline at end of file