diff --git a/libraries/primitive_consul_lock.rb b/libraries/primitive_consul_lock.rb index 8e74199..5cbcf26 100644 --- a/libraries/primitive_consul_lock.rb +++ b/libraries/primitive_consul_lock.rb @@ -121,7 +121,7 @@ def self.get_or_create(path, concurrency:, **kwargs) value = Mash.new({ version: 1, concurrency: concurrency, holders: {} }) current_lock = begin Chef::Log.info "Fetch lock state for #{path}" - Diplomat::Kv.get(path, decode_values: true, dc: dc, token: dc) + Diplomat::Kv.get(path, decode_values: true, dc: dc, token: token) rescue Faraday::ConnectionFailed => e retry_secs = 30 Chef::Log.info "Consul did not respond, wait #{retry_secs} seconds and retry to let it (re)start: #{e}"