diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureChangedHandler.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureChangedHandler.cs index 2697b7f2e5..6781ab09ae 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureChangedHandler.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureChangedHandler.cs @@ -1,22 +1,22 @@ using System.Threading.Tasks; -using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; namespace Volo.CmsKit.Blogs { - public class BlogFeatureChangedHandler : IDistributedEventHandler, ITransientDependency + public class BlogFeatureChangedHandler : ILocalEventHandler, ITransientDependency { - protected IDistributedCache Cache { get; } + protected IBlogFeatureCacheManager CacheManager { get; } - public BlogFeatureChangedHandler(IDistributedCache cache) + public BlogFeatureChangedHandler(IBlogFeatureCacheManager cacheManager) { - Cache = cache; + CacheManager = cacheManager; } public async Task HandleEventAsync(BlogFeatureChangedEto eventData) { - await Cache.RemoveAsync($"{eventData.BlogId}_{eventData.FeatureName}"); + await CacheManager.ClearAsync(eventData.BlogId, eventData.FeatureName); } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs index baeca63485..c5f9d825de 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Domain.Services; using Volo.Abp.EventBus.Distributed; +using Volo.Abp.EventBus.Local; using Volo.Abp.Uow; namespace Volo.CmsKit.Blogs @@ -15,13 +16,13 @@ namespace Volo.CmsKit.Blogs protected IUnitOfWorkManager UnitOfWorkManager { get; } - protected IDistributedEventBus EventBus { get; } + protected ILocalEventBus EventBus { get; } public BlogFeatureManager( IBlogFeatureRepository blogFeatureRepository, IDefaultBlogFeatureProvider defaultBlogFeatureProvider, IUnitOfWorkManager unitOfWorkManager, - IDistributedEventBus eventBus) + ILocalEventBus eventBus) { BlogFeatureRepository = blogFeatureRepository; DefaultBlogFeatureProvider = defaultBlogFeatureProvider;