Skip to content

Commit

Permalink
rename helper
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Mar 11, 2024
1 parent 1f7e7c2 commit d2bed70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eve_elastic/elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ def reindex(self, resource, *, requests_per_second=1000): # noqa: F811
try:
es.indices.get(index=alias)
print("Old index is not using an alias.")
_async_reindex(es, alias, new_index)
_background_reindex(es, alias, new_index)
es.indices.update_aliases(
body={
"actions": [
Expand Down Expand Up @@ -1126,7 +1126,7 @@ def reindex(self, resource, *, requests_per_second=1000): # noqa: F811
}
)

_async_reindex(
_background_reindex(
es, old_index, new_index, requests_per_second=requests_per_second
)

Expand Down Expand Up @@ -1158,13 +1158,13 @@ def reindex(self, resource, *, requests_per_second=1000): # noqa: F811
)

# do it as fast as possible
_async_reindex(es, tmp_index, new_index)
_background_reindex(es, tmp_index, new_index)

print("REMOVE TMP INDEX", tmp_index)
es.indices.delete(index=tmp_index)


def _async_reindex(
def _background_reindex(
es: Elasticsearch, old_index: str, new_index: str, *, requests_per_second=None
):
resp = es.reindex(
Expand Down

0 comments on commit d2bed70

Please sign in to comment.