Skip to content

Commit

Permalink
0.3.2: fix: reduce fetch size
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Jan 10, 2023
1 parent 2ad64e7 commit 374d8ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion search/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ def refresh(request: Notes, _: Settings = Depends(get_settings)):
# in the index metadata
ids_to_fetch = df.note_path.apply(urllib.parse.quote).tolist()
# split in chunks of n because fetch has a limit of size
n = 500
n = 200
ids_to_fetch = [ids_to_fetch[i : i + n] for i in range(0, len(ids_to_fetch), n)]
logger.info(f"Fetching {len(ids_to_fetch)} chunks of {n} ids")
with ThreadPool(len(ids_to_fetch)) as pool:
existing_documents = pool.map(
lambda n: index.fetch(ids=n, namespace=request.namespace), ids_to_fetch
Expand Down
4 changes: 2 additions & 2 deletions service.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ spec:
successThreshold: 1
failureThreshold: 60

image: gcr.io/obsidian-ai/obsidian-search:0.3.1
image: gcr.io/obsidian-ai/obsidian-search:0.3.2
env:
- name: SENTRY_RELEASE
value: "0.3.1"
value: "0.3.2"
- name: ENVIRONMENT
value: "production"
- name: UPLOAD_BATCH_SIZE
Expand Down

0 comments on commit 374d8ba

Please sign in to comment.