Skip to content

Commit

Permalink
Add expiration to session and repositories cache keys
Browse files Browse the repository at this point in the history
  • Loading branch information
BGMP committed Aug 12, 2024
1 parent 08c5622 commit 102febe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def show
require 'rva_calculate_results_service'

@count = 0
@rva_results = Rails.cache.fetch("Session:#{@session.id}") do
@rva_results = Rails.cache.fetch("Session:#{@session.id}", :expires_in => 1.month) do
RvaCalculateResultsService.new(@session).call
end

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/repositories_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module RepositoriesHelper
# NOTE: The staff team will likely not lie about their github accounts... but it'd be nice to
# add a separate field for them to have internal VCS accounts.
def user_by_github(github)
Rails.cache.fetch("User##{github}") do
Rails.cache.fetch("User##{github}", :expires_in => 1.month) do
User.find { |u| (u.profile.github.eql?(github) && user_is_staff?(u)) }
end
end
Expand Down

0 comments on commit 102febe

Please sign in to comment.