Include programmatically created resources in the resource cache
This commit is contained in:
1 parent
f2f508ac2e
commit
2bba6af6d9
1 file changed
+2
-6
+2
-6
@@ -108,13 +108,9 @@ public class CachedResourceStore implements ResourceStore {
|
||||
|
||||
@Override
|
||||
public List<Resource> findByOwner(String ownerId) {
|
||||
List<String> cachedIds = this.cache.get(getResourceOwnerCacheKey(ownerId));
|
||||
|
||||
if (cachedIds == null) {
|
||||
for (Resource resource : getDelegate().findByOwner(ownerId)) {
|
||||
updateCachedIds(getResourceOwnerCacheKey(ownerId), resource, true);
|
||||
}
|
||||
cachedIds = this.cache.getOrDefault(getResourceOwnerCacheKey(ownerId), Collections.emptyList());
|
||||
for (Resource resource : getDelegate().findByOwner(ownerId)) {
|
||||
updateCachedIds(getResourceOwnerCacheKey(ownerId), resource, true);
|
||||
}
|
||||
|
||||
return ((List<String>) this.cache.getOrDefault(getResourceOwnerCacheKey(ownerId), Collections.emptyList())).stream().map(this::findById)
|
||||
|
||||
Reference in new issue
Block a user