Merge pull request #4456 from pedroigor/master

[KEYCLOAK-5389] - Invalidating ResourceStore.findByUri cache when creating new resources
This commit is contained in:
Pedro Igor 2017-09-05 14:35:59 -03:00 committed by GitHub
commit c8eeeffdeb

View file

@ -509,8 +509,9 @@ public class StoreFactoryCacheSession implements CachedStoreFactoryProvider {
@Override
public Resource create(String name, ResourceServer resourceServer, String owner) {
Resource resource = getResourceStoreDelegate().create(name, resourceServer, owner);
Resource cached = findById(resource.getId(), resourceServer.getId());
registerResourceInvalidation(resource.getId(), resource.getName(), resource.getType(), resource.getUri(), resource.getScopes().stream().map(scope -> scope.getId()).collect(Collectors.toSet()), resourceServer.getId(), resource.getOwner());
return resource;
return cached;
}
@Override