mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-26 15:40:21 +00:00
Retry with host from config when it failed to resolve SRV
This commit is contained in:
+7
-3
@@ -104,13 +104,17 @@ class Client:
|
||||
def load_members(self):
|
||||
load_from_srv = False
|
||||
if not self._base_uri:
|
||||
if not 'discovery_srv' in self._config and not 'host' in self._config:
|
||||
raise Exception('Neither discovery_srv nor host are defined in etcd section of config')
|
||||
|
||||
if 'discovery_srv' in self._config:
|
||||
load_from_srv = True
|
||||
self._members_cache = self.get_peers_urls_from_dns(self._config['discovery_srv'])
|
||||
elif 'host' in self._config:
|
||||
|
||||
if not self._members_cache and 'host' in self._config:
|
||||
load_from_srv = False
|
||||
self._members_cache = self.get_client_urls_from_dns(self._config['host'])
|
||||
else:
|
||||
raise Exception('Neither discovery_srv nor host are defined in etcd section of config')
|
||||
|
||||
self._next_server()
|
||||
|
||||
response, status_code = self._get('/members')
|
||||
|
||||
Reference in New Issue
Block a user