Skip to content
Snippets Groups Projects
Commit 19288135 authored by Gabriel Mazetto's avatar Gabriel Mazetto 🕵🏻
Browse files

Refactor patroni's dynamic_settings loop

parent 3c4422f0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3,7 +3,6 @@ class PatroniHelper < BaseHelper
 
DCS_ATTRIBUTES ||= %w(loop_wait ttl retry_timeout maximum_lag_on_failover max_timelines_history master_start_timeout).freeze
DCS_POSTGRESQL_ATTRIBUTES ||= %w(use_pg_rewind use_slots).freeze
DCS_STANDBY_CLUSTER_ATTRIBUTES ||= %w(host port primary_slot_name).freeze
 
attr_reader :node
 
Loading
Loading
@@ -67,8 +66,10 @@ class PatroniHelper < BaseHelper
if node['patroni']['standby_cluster']['enable']
dcs['standby_cluster'] = {}
 
DCS_STANDBY_CLUSTER_ATTRIBUTES.each do |key|
dcs['standby_cluster'][key] = node['patroni']['standby_cluster'][key]
node['patroni']['standby_cluster'].each do |key, value|
next if key == 'enable'
dcs['standby_cluster'][key] = value
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment