mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +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;
|
ExtensionEntry extensionEntry;
|
||||||
try {
|
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) {
|
catch (Exception ex) {
|
||||||
|
Logger.Error(ex, "Error loading extension '{0}'", extensionId);
|
||||||
throw new OrchardException(T("Error while loading extension '{0}'.", extensionId), ex);
|
throw new OrchardException(T("Error while loading extension '{0}'.", extensionId), ex);
|
||||||
}
|
}
|
||||||
if (extensionEntry == null) {
|
if (extensionEntry == null) {
|
||||||
|
Reference in New Issue
Block a user