Method: SecretConfig::Registry#refresh!

Defined in:
lib/secret_config/registry.rb

#refresh!Object

Refresh the in-memory cached copy of the centralized configuration information. Environment variable values will take precedence over the central store values.



92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/secret_config/registry.rb', line 92

def refresh!
  existing_keys = cache.keys
  updated_keys  = []
  fetch_path(path).each_pair do |key, value|
    cache[key] = env_var_override(key, value)
    updated_keys << key
  end

  # Remove keys deleted from the central registry.
  (existing_keys - updated_keys).each { |key| provider.delete(key) }

  true
end