Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a parameter to disable the multicollins cache #437

Merged
merged 1 commit into from
Apr 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/collins/models/RemoteAssetFinder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ object RemoteAssetFinder {
val stream = Cache.getAs[RemoteAssetStream](key).getOrElse(new RemoteAssetStream(clients, searchParams))
val results = stream.slice(pageParams.page * pageParams.size, (pageParams.page + 1) * (pageParams.size))
val timeout = MultiCollinsConfig.queryCacheTimeout
Cache.set(key, stream, timeout)
if (MultiCollinsConfig.cacheEnabled) {
Cache.set(key, stream, timeout)
}
(results, stream.aggregateTotal)
}

Expand Down
1 change: 1 addition & 0 deletions app/collins/util/config/MultiCollinsConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ object MultiCollinsConfig extends Configurable {
def locationAttribute = getString("locationAttribute", "LOCATION")
def thisInstance = getString("thisInstance")
def queryCacheTimeout = getInt("queryCacheTimeout", 30)
def cacheEnabled = getBoolean("cacheEnabled", true)

override def validateConfig() {
if (enabled) {
Expand Down
1 change: 1 addition & 0 deletions conf/reference/multicollins_reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ multicollins {
locationAttribute = LOCATION
thisInstance = NONE
queryCacheTimeout = 30
cacheEnabled = true
}