From 546139e82f151b35d6492b7cbf2ac89dbfd5d0b5 Mon Sep 17 00:00:00 2001 From: kamtschatka Date: Sun, 9 Jun 2024 20:11:23 +0200 Subject: fix: Trigger search re-index on bookmark tag manual updates. Fixes #208 (#210) * re-index of database is not scanning all places when bookmark tags are changed. Manual indexing is working as workaround #208 introduced a new function to trigger a reindex to reduce copy/paste added missing reindexes when tags are deleted/bookmarks are updated * give functions a bit more descriptive name --------- Co-authored-by: kamtschatka Co-authored-by: MohamedBassem --- apps/workers/openaiWorker.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'apps/workers/openaiWorker.ts') diff --git a/apps/workers/openaiWorker.ts b/apps/workers/openaiWorker.ts index 7b74e4c3..776d6828 100644 --- a/apps/workers/openaiWorker.ts +++ b/apps/workers/openaiWorker.ts @@ -17,7 +17,7 @@ import logger from "@hoarder/shared/logger"; import { OpenAIQueue, queueConnectionDetails, - SearchIndexingQueue, + triggerSearchReindex, zOpenAIRequestSchema, } from "@hoarder/shared/queues"; @@ -396,8 +396,5 @@ async function runOpenAI(job: Job) { await connectTags(bookmarkId, tags, bookmark.userId); // Update the search index - SearchIndexingQueue.add("search_indexing", { - bookmarkId, - type: "index", - }); + triggerSearchReindex(bookmarkId); } -- cgit v1.2.3-70-g09d2