Skip to content

Commit

Permalink
SAK-23642 - Clear cache on update and delete (sakaiproject#4368)
Browse files Browse the repository at this point in the history
  • Loading branch information
csev authored May 4, 2017
1 parent 081c7e7 commit 1d9d204
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -985,12 +985,9 @@ protected void doSave(BaseSite site, boolean isNew)
// complete the edit
storage().save(site);

// Check to see if an this is an interesting enough change to invalidate the user-site cache.
// For now, we just check if the title changed because that persists in the portal navigation.
// As with other areas, if the main and user-site caches were more integrated (keeping references
// for users rather than copies), we would not have to synchronize explicitly here.
// Invalidate the user-site cache.
Site cached = getCachedSite(site.getId());
if (cached != null && site.getTitle() != null && !site.getTitle().equals(cached.getTitle())) {
if (cached != null ) {
clearUserCacheForSite(site);
}
cacheSite(site);
Expand Down Expand Up @@ -1403,6 +1400,12 @@ public void removeSite(Site site) throws PermissionException, IdUnusedException
{
advisor.removed(site);
}

// Invalidate the user-site cache.
Site cached = getCachedSite(site.getId());
if (cached != null ) {
clearUserCacheForSite(site);
}

// complete the edit
storage().remove(site);
Expand Down

0 comments on commit 1d9d204

Please sign in to comment.