Populate cache in ConfigFileApplicationListener
Fix `ConfigFileApplicationListener` so that the loadDocumentsCache is populated when documents are loaded. Closes gh-12732
This commit is contained in:
parent
35b4cd01ab
commit
cc66de28d0
|
@ -539,12 +539,12 @@ public class ConfigFileApplicationListener
|
|||
|
||||
private List<Document> loadDocuments(PropertySourceLoader loader, String name,
|
||||
Resource resource) throws IOException {
|
||||
loader.load(name, resource);
|
||||
DocumentsCacheKey cacheKey = new DocumentsCacheKey(loader, resource);
|
||||
List<Document> documents = this.loadDocumentsCache.get(cacheKey);
|
||||
if (documents == null) {
|
||||
List<PropertySource<?>> loaded = loader.load(name, resource);
|
||||
documents = asDocuments(loaded);
|
||||
this.loadDocumentsCache.put(cacheKey, documents);
|
||||
}
|
||||
return documents;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue