Commit 2771c58a authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed the parallel indexing. [skip ci]

parent 04fddfa8
Pipeline #53081 skipped
......@@ -50,8 +50,10 @@ def index(threads):
yield entry
if threads > 1:
elasticsearch.helpers.parallel_bulk(
infrastructure.elastic_client, elastic_updates(), chunk_size=1000, thread_count=threads)
for _ in elasticsearch.helpers.parallel_bulk(
infrastructure.elastic_client, elastic_updates(), chunk_size=1000,
thread_count=threads):
pass
else:
elasticsearch.helpers.bulk(
infrastructure.elastic_client, elastic_updates())
......
......@@ -51,7 +51,7 @@ class TestAdmin:
assert search.entry_search(search_parameters=dict(comment='specific'))['pagination']['total'] == 0
result = click.testing.CliRunner().invoke(
cli, ['admin', 'index'], catch_exceptions=False, obj=utils.POPO())
cli, ['admin', 'index', '--threads', '2'], catch_exceptions=False, obj=utils.POPO())
assert result.exit_code == 0
assert 'index' in result.stdout
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment