【问题标题】:ICacheManager not working as intended inside ISingletonDependency implementationICacheManager 在 ISingletonDependency 实现中未按预期工作
【发布时间】:2015-04-27 21:00:43
【问题描述】:

我开发了一个自定义搜索提供程序CustomIndexProvider 实现IIndexProvider 并抑制Lucene.Services.LuceneIndexProvider。出于某种原因,CacheManager 总是在 AcquireContext 方法中执行实现并且它不缓存。

 var mappingsFound = this.m_cacheManager.Get(cacheKey, ctx =>
            {
                ////Logic goes here
                return true/false;
            });

我的实现出了什么问题?

我是否受到这个问题https://orchard.codeplex.com/discussions/448781的影响?

仅供参考:

  1. CustomIndexProviderDefaultProcessingEngine.Execute 调用。每当需要更新我的索引时,我都会创建一个IIndexingTaskManager.CreateUpdateIndexTask 任务。
  2. 我还发现 CustomIndexProvider 会为每个任务创建,即使它继承了 ISingletonDependency

【问题讨论】:

  • 你能发布实现吗?
  • @martinbc 请查看更新后的问题。可能问题出在其他地方。

标签: orchardcms orchardcms-1.7


【解决方案1】:

会导致此行为的一件事是,如果您的 cacheKey 值在每次调用此代码时都不同。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-31
    • 2021-06-04
    相关资源
    最近更新 更多