mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 02:44:52 +08:00
Fix too aggressive caching of loaded extensions
--HG-- branch : dev
This commit is contained in:
@@ -80,9 +80,18 @@ namespace Orchard.Environment.Extensions {
|
||||
|
||||
ExtensionEntry extensionEntry;
|
||||
try {
|
||||
extensionEntry = _cacheManager.Get(extensionId, ctx => BuildEntry(extensionDescriptor));
|
||||
extensionEntry = _cacheManager.Get(extensionId, ctx => {
|
||||
var entry = BuildEntry(extensionDescriptor);
|
||||
if (entry != null) {
|
||||
foreach (var loader in _loaders) {
|
||||
loader.Monitor(entry.Descriptor, (token) => ctx.Monitor(token));
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Logger.Error(ex, "Error loading extension '{0}'", extensionId);
|
||||
throw new OrchardException(T("Error while loading extension '{0}'.", extensionId), ex);
|
||||
}
|
||||
if (extensionEntry == null) {
|
||||
|
Reference in New Issue
Block a user