Ensure context cache stats are logged when ApplicationContext fails to load
Closes gh-30635
This commit is contained in:
parent
439bcd6715
commit
1a26e17f41
|
@ -109,6 +109,7 @@ public class DefaultCacheAwareContextLoaderDelegate implements CacheAwareContext
|
|||
mergedContextConfiguration = replaceIfNecessary(mergedContextConfiguration);
|
||||
synchronized (this.contextCache) {
|
||||
ApplicationContext context = this.contextCache.get(mergedContextConfiguration);
|
||||
try {
|
||||
if (context == null) {
|
||||
try {
|
||||
if (mergedContextConfiguration instanceof AotMergedContextConfiguration aotMergedConfig) {
|
||||
|
@ -149,8 +150,10 @@ public class DefaultCacheAwareContextLoaderDelegate implements CacheAwareContext
|
|||
System.identityHashCode(context), mergedContextConfiguration));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
this.contextCache.logStatistics();
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue