Skip to content

Commit

Permalink
Use set_client() instead of passing in a client instance (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrookins authored Feb 12, 2025
1 parent ebed3f9 commit eb09692
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/arxivsearch/db/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def preprocess_paper(paper: dict) -> dict:
_ = await index.load(
data=papers,
preprocess=preprocess_paper,
concurrency=config.WRITE_CONCURRENCY,
concurrency=int(config.WRITE_CONCURRENCY),
id_field="id",
)

Expand All @@ -74,7 +74,8 @@ async def preprocess_paper(paper: dict) -> dict:

async def load_data():
# Load schema specs and create index in Redis
index = AsyncSearchIndex(redis_helpers.schema, redis_helpers.client)
index = AsyncSearchIndex(redis_helpers.schema)
await index.set_client(redis_helpers.client)

# Load dataset and create index
try:
Expand Down

0 comments on commit eb09692

Please sign in to comment.