Browse Source

Fix flash sales cache invalidators

pull/219/head
gdlcf88 4 years ago
parent
commit
fa6d13e952
  1. 2
      plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanCacheInvalidator.cs
  2. 4
      plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Products/Products/ProductCacheInvalidator.cs

2
plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanCacheInvalidator.cs

@ -25,7 +25,7 @@ public class FlashSalePlanCacheInvalidator : ILocalEventHandler<EntityChangedEve
{
await DistributedCache.RemoveAsync(eventData.Entity.Id);
UnitOfWorkManager.Current.OnCompleted(async () =>
UnitOfWorkManager.Current?.OnCompleted(async () =>
{
await DistributedCache.RemoveAsync(eventData.Entity.Id);
});

4
plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Products/Products/ProductCacheInvalidator.cs

@ -28,7 +28,7 @@ public class ProductCacheInvalidator :
{
await DistributedCache.RemoveAsync(eventData.Entity.Id);
UnitOfWorkManager.Current.OnCompleted(async () =>
UnitOfWorkManager.Current?.OnCompleted(async () =>
{
await DistributedCache.RemoveAsync(eventData.Entity.Id);
});
@ -38,7 +38,7 @@ public class ProductCacheInvalidator :
{
await DistributedCache.RemoveAsync(eventData.Entity.Id);
UnitOfWorkManager.Current.OnCompleted(async () =>
UnitOfWorkManager.Current?.OnCompleted(async () =>
{
await DistributedCache.RemoveAsync(eventData.Entity.Id);
});

Loading…
Cancel
Save