Skip to content

Commit

Permalink
cache registry small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Feb 23, 2018
1 parent a2769f7 commit 6d933f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Expand Up @@ -406,13 +406,6 @@ public Collection<ObjectDeltaOperation<? extends ObjectType>> executeChanges(fin
}
}

if (delta.getObjectTypeClass() == FunctionLibraryType.class) {
List<Cacheable> cacheableServices = cacheRegistry.getCacheableServices();
for (Cacheable cacheableService : cacheableServices) {
cacheableService.clearCache();
}
}

final boolean preAuthorized = ModelExecuteOptions.isPreAuthorized(options);
PrismObject objectToDetermineDetailsForAudit = null;
try {
Expand Down Expand Up @@ -620,6 +613,11 @@ private void invalidateCaches(Collection<ObjectDeltaOperation<? extends ObjectTy
systemObjectCache.invalidateCaches();
}
}

if (objectDelta.getObjectTypeClass() == FunctionLibraryType.class) {
cacheRegistry.clearAllCaches();
}

}
}

Expand Down
Expand Up @@ -1644,10 +1644,7 @@ public ExecuteCredentialResetResponseType executeCredentialsReset(PrismObject<Us
}

public void clearCaches() {
List<Cacheable> cacheableServices = cacheRegistry.getCacheableServices();
for (Cacheable cacheable: cacheableServices) {
cacheable.clearCache();
}
cacheRegistry.clearAllCaches();
}


Expand Down
Expand Up @@ -32,4 +32,11 @@ public void registerCacheableService(Cacheable cacheableService) {
public List<Cacheable> getCacheableServices() {
return cacheableServices;
}

public void clearAllCaches() {
for (Cacheable cacheableService : cacheableServices) {
cacheableService.clearCache();
}
}
}

0 comments on commit 6d933f8

Please sign in to comment.