Merge pull request #4548 from sbwalker/dev

fix #4546 - handle cache invalidation for site deletion
This commit is contained in:
Shaun Walker 2024-08-22 08:26:44 -04:00 committed by GitHub
commit aa435d6e94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,7 @@ namespace Oqtane.Infrastructure.EventSubscribers
}
// 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)
if (syncEvent.EntityName == EntityNames.Site && (syncEvent.Action == SyncEventActions.Update || syncEvent.Action == SyncEventActions.Delete))
{
_cache.Remove($"assemblieslist:{syncEvent.TenantId}:{syncEvent.EntityId}");
_cache.Remove($"assemblies:{syncEvent.TenantId}:{syncEvent.EntityId}");

View File

@ -235,6 +235,7 @@ namespace Oqtane.Services
{
_sites.DeleteSite(siteId);
_syncManager.AddSyncEvent(alias, EntityNames.Site, site.SiteId, SyncEventActions.Delete);
_syncManager.AddSyncEvent(alias, EntityNames.Site, site.SiteId, SyncEventActions.Refresh);
_logger.Log(siteId, LogLevel.Information, this, LogFunction.Delete, "Site Deleted {SiteId}", siteId);
}
else