From d2bed701a2b1acecfaca37210fb1c8bf1b2edccb Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Mon, 11 Mar 2024 09:57:39 +0100 Subject: [PATCH] rename helper --- eve_elastic/elastic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eve_elastic/elastic.py b/eve_elastic/elastic.py index bbe2f8f..6f450d9 100644 --- a/eve_elastic/elastic.py +++ b/eve_elastic/elastic.py @@ -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": [ @@ -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 ) @@ -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(