invalidate client assemblies cache when site is updated
This commit is contained in:
parent
a152d8664d
commit
5d1510083e
|
@ -15,10 +15,18 @@ namespace Oqtane.Infrastructure.EventSubscribers
|
||||||
|
|
||||||
public void EntityChanged(SyncEvent syncEvent)
|
public void EntityChanged(SyncEvent syncEvent)
|
||||||
{
|
{
|
||||||
|
// when site entities change (ie. site, pages, modules, etc...) a site refresh event is raised and the site cache item needs to be refreshed
|
||||||
if (syncEvent.EntityName == EntityNames.Site && syncEvent.Action == SyncEventActions.Refresh)
|
if (syncEvent.EntityName == EntityNames.Site && syncEvent.Action == SyncEventActions.Refresh)
|
||||||
{
|
{
|
||||||
_cache.Remove($"site:{syncEvent.TenantId}:{syncEvent.EntityId}");
|
_cache.Remove($"site:{syncEvent.TenantId}:{syncEvent.EntityId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when a site entity is updated the hosting model may have changed, so the client assemblies cache items need to be refreshed
|
||||||
|
if (syncEvent.EntityName == EntityNames.Site && syncEvent.Action == SyncEventActions.Update)
|
||||||
|
{
|
||||||
|
_cache.Remove($"assemblieslist:{syncEvent.TenantId}:{syncEvent.EntityId}");
|
||||||
|
_cache.Remove($"assemblies:{syncEvent.TenantId}:{syncEvent.EntityId}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user