Skip to content

Commit

Permalink
Merge pull request #359 from alexandergraul/fix/distribution-list-cac…
Browse files Browse the repository at this point in the history
…hing

don't force cache misses
  • Loading branch information
dmacvicar committed Jul 5, 2018
2 parents 45b0499 + 3a4ef40 commit 9def587
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions app/controllers/obs_controller.rb
Expand Up @@ -8,9 +8,7 @@ class OBSController < ApplicationController
before_action :set_releases_parameters

def set_distributions
@distributions = Rails.cache.fetch('distributions',
expires_in: 120.minutes,
force: true) do
@distributions = Rails.cache.fetch('distributions', expires_in: 120.minutes) do
load_distributions
end
rescue OBSError
Expand Down
2 changes: 2 additions & 0 deletions test/integration/obs_controller_test.rb
Expand Up @@ -16,6 +16,8 @@ def mock.get
end

ApiConnect.stub :get, mock do
# Otherwise the controller would get the distributions from cache
Rails.cache.clear
get '/explore'
assert_includes body, 'Connection to OBS is unavailable.'
assert_equal 200, status
Expand Down

0 comments on commit 9def587

Please sign in to comment.