Skip to content

Commit

Permalink
Avoid memoizing network-related false negatives of GCECredentials.on_…
Browse files Browse the repository at this point in the history
…gce? (#137)
  • Loading branch information
serihiro authored and dazuma committed Jun 5, 2018
1 parent 9232aa3 commit edaa784
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/googleauth/application_default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ def get_application_default(scope = nil, options = {})
DefaultCredentials.from_well_known_path(scope) ||
DefaultCredentials.from_system_default_path(scope)
return creds unless creds.nil?
raise NOT_FOUND_ERROR unless GCECredentials.on_gce?(options)
unless GCECredentials.on_gce?(options)
# Clear cache of the result of GCECredentials.on_gce?
GCECredentials.unmemoize_all
raise NOT_FOUND_ERROR
end
GCECredentials.new
end

Expand Down

0 comments on commit edaa784

Please sign in to comment.