mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-26 07:30:14 +00:00
Remove watchdog from __DEFAULT_CONFIG (#2660)
This commit is contained in:
@@ -196,9 +196,6 @@ class Config(object):
|
||||
'use_slots': True,
|
||||
'parameters': CaseInsensitiveDict({p: v[0] for p, v in ConfigHandler.CMDLINE_OPTIONS.items()
|
||||
if p not in ('wal_keep_segments', 'wal_keep_size')})
|
||||
},
|
||||
'watchdog': {
|
||||
'mode': 'automatic',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,12 +39,14 @@ def synchronized(func):
|
||||
class WatchdogConfig(object):
|
||||
"""Helper to contain a snapshot of configuration"""
|
||||
def __init__(self, config):
|
||||
self.mode = parse_mode(config['watchdog'].get('mode', 'automatic'))
|
||||
watchdog_config = config.get("watchdog") or {'mode': 'automatic'}
|
||||
|
||||
self.mode = parse_mode(watchdog_config.get('mode', 'automatic'))
|
||||
self.ttl = config['ttl']
|
||||
self.loop_wait = config['loop_wait']
|
||||
self.safety_margin = config['watchdog'].get('safety_margin', 5)
|
||||
self.driver = config['watchdog'].get('driver', 'default')
|
||||
self.driver_config = dict((k, v) for k, v in config['watchdog'].items()
|
||||
self.safety_margin = watchdog_config.get('safety_margin', 5)
|
||||
self.driver = watchdog_config.get('driver', 'default')
|
||||
self.driver_config = dict((k, v) for k, v in watchdog_config.items()
|
||||
if k not in ['mode', 'safety_margin', 'driver'])
|
||||
|
||||
def __eq__(self, other):
|
||||
|
||||
Reference in New Issue
Block a user