2015-04-27 26 views
0

我開發了一個自定義搜索提供程序CustomIndexProvider,實現了IIndexProvider並抑制了Lucene.Services.LuceneIndexProvider。出於某種原因,CacheManager始終執行AcquireContext方法內的實現,並且不會緩存。ICacheManager在ISingletonDependency實現中無法按預期工作

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

我的實施出了什麼問題?

我受此問題影響https://orchard.codeplex.com/discussions/448781

FYI:

  1. CustomIndexProvider會從DefaultProcessingEngine.Execute調用。每當有需要更新我的索引時,我都會創建一個IIndexingTaskManager.CreateUpdateIndexTask任務。
  2. 我還發現爲每個任務創建CustomIndexProvider,儘管它繼承了ISingletonDependency
+0

你可以發佈實施? – mberacochea

+0

@martinbc請看看最新的問題。可能是其他地方的問題。 – Ahuman

回答

0

會導致此行爲的一件事情是,如果您的cacheKey值在每次調用此代碼時都不相同。