From 1ee1a5f2a1809437f58b9c869e893b6301c398b4 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 13 Sep 2021 19:10:52 -0400 Subject: [PATCH] fix es sync.py --- lbry/wallet/server/db/elasticsearch/sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbry/wallet/server/db/elasticsearch/sync.py b/lbry/wallet/server/db/elasticsearch/sync.py index 9bccb4090..d990c96cc 100644 --- a/lbry/wallet/server/db/elasticsearch/sync.py +++ b/lbry/wallet/server/db/elasticsearch/sync.py @@ -57,8 +57,9 @@ async def run_sync(index_name='claims', db=None, clients=32): logging.info("ES sync host: %s:%i", env.elastic_host, env.elastic_port) es = AsyncElasticsearch([{'host': env.elastic_host, 'port': env.elastic_port}]) claim_generator = get_all_claims(index_name=index_name, db=db) + try: - await asyncio.gather(*(async_bulk(es, claim_generator, request_timeout=600) for _ in range(clients))) + await async_bulk(es, claim_generator, request_timeout=600) await es.indices.refresh(index=index_name) finally: await es.close()