Merge pull request #3 from rgayon/timeout

Add timeout parameter for ElasticSearch
This commit is contained in:
Jason 2020-10-13 16:27:24 +11:00 committed by GitHub
commit f4d96c2ccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@ class ElasticsearchDataStore(object):
def __init__(self, host='127.0.0.1', port=9200):
"""Create an Elasticsearch client."""
super(ElasticsearchDataStore, self).__init__()
self.client = Elasticsearch([{'host': host, 'port': port}])
self.client = Elasticsearch([{'host': host, 'port': port}], timeout=30)
self.import_counter = collections.Counter()
self.import_events = []