Skip to content

Commit

Permalink
Fix the entitlements team cache when there are multiple instances of …
Browse files Browse the repository at this point in the history
…GitHub in use.
  • Loading branch information
chrisgavin committed Jan 28, 2024
1 parent 1e87a3c commit 398e3af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/entitlements/backend/github_team/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ class TeamNotFound < RuntimeError; end
def initialize(addr: nil, org:, token:, ou:, ignore_not_found: false)
super
Entitlements.cache[:github_team_members] ||= {}
Entitlements.cache[:github_team_members][org] ||= {}
@team_cache = Entitlements.cache[:github_team_members][org]
Entitlements.cache[:github_team_members][addr] ||= {}
Entitlements.cache[:github_team_members][addr][org] ||= {}
@team_cache = Entitlements.cache[:github_team_members][addr][org]
end

# Read a single team identified by its slug and return a team object.
Expand Down

0 comments on commit 398e3af

Please sign in to comment.