Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
2771c58a
Commit
2771c58a
authored
Aug 02, 2019
by
Markus Scheidgen
Browse files
Fixed the parallel indexing. [skip ci]
parent
04fddfa8
Pipeline
#53081
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/cli/admin/admin.py
View file @
2771c58a
...
...
@@ -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
())
...
...
tests/test_cli.py
View file @
2771c58a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment