Skip to content

Commit 32b3843

Browse files
committed
Setting REDIS_KEEP_DOCUMENTS=1 as default
1 parent 946ff60 commit 32b3843

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

engine/clients/redis/configure.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def clean(self):
6666
print(
6767
"Given the FT.DROPINDEX command failed, we're flushing the entire DB..."
6868
)
69-
conn.flushall()
69+
if REDIS_KEEP_DOCUMENTS is False:
70+
conn.flushall()
7071
else:
7172
raise e
7273

@@ -122,18 +123,6 @@ def recreate(self, dataset: Dataset, collection_params):
122123
except redis.ResponseError as e:
123124
if "Index already exists" not in e.__str__():
124125
raise e
125-
if REDIS_KEEP_DOCUMENTS:
126-
percent_index = float(search_namespace.info().get("percent_indexed"))
127-
while percent_index < 1.0:
128-
print(
129-
"waiting for index to be fully processed. current percent index: {}".format(
130-
percent_index * 100.0
131-
)
132-
)
133-
time.sleep(5)
134-
percent_index = float(
135-
search_namespace.info().get("percent_indexed")
136-
)
137126

138127

139128
if __name__ == "__main__":

0 commit comments

Comments
 (0)