Skip to content

Commit

Permalink
Add a parameter to disable the multicollins cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Richard committed Apr 12, 2016
1 parent 1af1322 commit 52af695
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
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
}

0 comments on commit 52af695

Please sign in to comment.