diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs index bb03a15c9..f87f4feb0 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs @@ -122,13 +122,16 @@ namespace LY.MicroService.RealtimeMessage.EventBus.Distributed if (notification.NotificationType == NotificationType.System) { - await SendToTenantAsync(null, notification, eventData); + using (CurrentTenant.Change(null)) + { + await SendToTenantAsync(null, notification, eventData); - var allActiveTenants = await TenantConfigurationCache.GetTenantsAsync(); + var allActiveTenants = await TenantConfigurationCache.GetTenantsAsync(); - foreach (var activeTenant in allActiveTenants) - { - await SendToTenantAsync(activeTenant.Id, notification, eventData); + foreach (var activeTenant in allActiveTenants) + { + await SendToTenantAsync(activeTenant.Id, notification, eventData); + } } } else @@ -148,13 +151,16 @@ namespace LY.MicroService.RealtimeMessage.EventBus.Distributed if (notification.NotificationType == NotificationType.System) { - await SendToTenantAsync(null, notification, eventData); + using (CurrentTenant.Change(null)) + { + await SendToTenantAsync(null, notification, eventData); - var allActiveTenants = await TenantConfigurationCache.GetTenantsAsync(); + var allActiveTenants = await TenantConfigurationCache.GetTenantsAsync(); - foreach (var activeTenant in allActiveTenants) - { - await SendToTenantAsync(activeTenant.Id, notification, eventData); + foreach (var activeTenant in allActiveTenants) + { + await SendToTenantAsync(activeTenant.Id, notification, eventData); + } } } else diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj index 91c10d8a5..df7137706 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj @@ -37,6 +37,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs index 78ef7910c..3d72cf4cd 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs @@ -39,6 +39,7 @@ using Volo.Abp.Autofac; using Volo.Abp.BackgroundWorkers; using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.Modularity; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.TextTemplating.Scriban; @@ -65,6 +66,7 @@ namespace LY.MicroService.RealtimeMessage; typeof(TaskManagementEntityFrameworkCoreModule), typeof(AbpMessageServiceEntityFrameworkCoreModule), typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpLocalizationManagementEntityFrameworkCoreModule), diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.Development.json b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.Development.json index 30553c5dd..7ce2b7af2 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.Development.json +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.Development.json @@ -28,6 +28,7 @@ "TaskManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", "AbpIdentity": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456", "AbpSaas": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", + "AbpFeatureManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", "AbpSettingManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", "AbpPermissionManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", "AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",