Skip to content

Commit

Permalink
Merge pull request #4548 from sbwalker/dev
Browse files Browse the repository at this point in the history
fix #4546 - handle cache invalidation for site deletion
  • Loading branch information
sbwalker authored Aug 22, 2024
2 parents 437aa45 + f6858c2 commit aa435d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void EntityChanged(SyncEvent syncEvent)
}

// 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}");
Expand Down
1 change: 1 addition & 0 deletions Oqtane.Server/Services/SiteService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ public Task DeleteSiteAsync(int siteId)
{
_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
Expand Down

0 comments on commit aa435d6

Please # to comment.