Remove watchdog from __DEFAULT_CONFIG (#2660)

This commit is contained in:
Polina Bungina
2023-05-04 08:37:39 +02:00
committed by GitHub
parent 4e1b9937b9
commit 1ac9b11f33
2 changed files with 6 additions and 7 deletions
-3
View File
@@ -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',
}
}
+6 -4
View File
@@ -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):