Skip to content

Commit

Permalink
fix ES default sniff config updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zcqian committed Oct 23, 2021
1 parent 8defa1e commit acf1190
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion biothings/web/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ def get_es_client(hosts=None, async_=False, **settings):
http_auth=awsauth, use_ssl=True, verify_certs=True,
connection_class=_AsyncConn if async_ else _Conn
)
elif settings.pop('sniff', None):

if settings.get('sniff', None) is None:
settings.update(
sniff=True,
sniff_on_start=True,
sniff_on_connection_fail=True,
sniffer_timeout=60
)

if async_:
from elasticsearch import AsyncElasticsearch
client = AsyncElasticsearch
Expand Down

0 comments on commit acf1190

Please sign in to comment.