diff --git a/app/lib/services.rb b/app/lib/services.rb index 884131c1f..0c3aedaad 100644 --- a/app/lib/services.rb +++ b/app/lib/services.rb @@ -6,8 +6,8 @@ def self.content_store @content_store ||= GdsApi::ContentStore.new(Plek.new.find("content-store")) end - def self.cached_search(params, metric_key: "search.request_time") - Rails.cache.fetch(params, expires_in: 5.minutes) do + def self.cached_search(params, metric_key: "search.request_time", expires_in: 5.minutes) + Rails.cache.fetch(params, expires_in:) do GovukStatsd.time(metric_key) do search_api.search(params).to_h end diff --git a/app/models/popular_list_set.rb b/app/models/popular_list_set.rb index 5044a0625..80c001345 100644 --- a/app/models/popular_list_set.rb +++ b/app/models/popular_list_set.rb @@ -29,7 +29,7 @@ def search_response order: "-popularity", fields: SearchApiFields::POPULAR_BROWSE_SEARCH_FIELDS, } - Services.cached_search(params) + Services.cached_search(params, expires_in: 12.hours) rescue GdsApi::HTTPServerError {} end