Skip to content

Commit

Permalink
fix: meilisearch size
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Apr 3, 2024
1 parent f38de9c commit 42ed6a1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
72 changes: 37 additions & 35 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gamewide/search/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 42ed6a1

Please sign in to comment.