Skip to content

Commit

Permalink
fix(cache): Remove anonymous noop SearchableProvider (#2450)
Browse files Browse the repository at this point in the history
An attempt to cut down on some useless redis calls being made for every
search.

I do not believe there is a need for a default `SearchableProvider`
implementation, there will almost certainly be a concrete `Bean`.
  • Loading branch information
ajordens committed Mar 23, 2018
1 parent 842a7ea commit 9aa9b42
Showing 1 changed file with 0 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,42 +69,6 @@ class CacheConfig {
}
}

@Bean
@ConditionalOnMissingBean(SearchableProvider)
SearchableProvider noopProvider() {
new SearchableProvider() {
@Override
String getProviderName() {
"noop"
}

@Override
Collection<CachingAgent> getAgents() {
Collections.emptySet()
}

@Override
Set<String> getDefaultCaches() {
Collections.emptySet()
}

@Override
Map<String, String> getUrlMappingTemplates() {
Collections.emptyMap()
}

@Override
Map<String, SearchableProvider.SearchResultHydrator> getSearchResultHydrators() {
Collections.emptyMap()
}

@Override
Map<String, String> parseKey(String key) {
null
}
}
}

@Bean
@ConditionalOnMissingBean(CatsModule)
CatsModule catsModule(List<Provider> providers, List<ExecutionInstrumentation> executionInstrumentation, NamedCacheFactory cacheFactory, AgentScheduler agentScheduler) {
Expand Down

0 comments on commit 9aa9b42

Please sign in to comment.