From 42ed6a13c196042a60ab0adaa19119bac372ed34 Mon Sep 17 00:00:00 2001
From: Magic <82341152+MagicTheDev@users.noreply.github.com>
Date: Tue, 2 Apr 2024 22:07:15 -0500
Subject: [PATCH] fix: meilisearch size
---
.idea/workspace.xml | 72 +++++++++++++++++++++-------------------
gamewide/search/track.py | 4 +--
2 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 17422b0..1aafc3b 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,8 @@
-
+
+
@@ -187,38 +188,6 @@
1706581825121
-
-
- 1711328349385
-
-
-
- 1711328349385
-
-
-
- 1711329016623
-
-
-
- 1711329016623
-
-
-
- 1711329029640
-
-
-
- 1711329029640
-
-
-
- 1711331292843
-
-
-
- 1711331292843
-
1711333171679
@@ -579,7 +548,39 @@
1712111488277
-
+
+
+ 1712112218908
+
+
+
+ 1712112218908
+
+
+
+ 1712112492304
+
+
+
+ 1712112492304
+
+
+
+ 1712112745948
+
+
+
+ 1712112745948
+
+
+
+ 1712113102870
+
+
+
+ 1712113102870
+
+
@@ -589,6 +590,7 @@
-
+
+
\ No newline at end of file
diff --git a/gamewide/search/track.py b/gamewide/search/track.py
index 5865122..0336c8b 100644
--- a/gamewide/search/track.py
+++ b/gamewide/search/track.py
@@ -16,7 +16,7 @@ async def main():
bot_clan_tags = await db_client.clans_db.distinct("tag")
all_tags = list(set(all_tags + bot_clan_tags))
logger.info(f"{len(all_tags)} tags")
- size_break = 100_000
+ size_break = 75_000
all_tags = [all_tags[i:i + size_break] for i in range(0, len(all_tags), size_break)]
for tag_group in all_tags:
@@ -64,7 +64,7 @@ async def add_documents(documents):
headers = {"Authorization": f"Bearer {config.meili_pw}"}
async with aiohttp.ClientSession() as session:
async with session.get('http://85.10.200.219:7700/tasks?limit=1', headers=headers) as response:
- if response.status == 200: # Meilisearch accepted the update
+ if response.status == 200:
data = await response.json()
results = data.get("results", [])
if results[0].get("status") == "succeeded":