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 --- packages/trpc/routers/admin.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'packages/trpc/routers/admin.ts') diff --git a/packages/trpc/routers/admin.ts b/packages/trpc/routers/admin.ts index 0a0af173..05831b92 100644 --- a/packages/trpc/routers/admin.ts +++ b/packages/trpc/routers/admin.ts @@ -6,6 +6,7 @@ import { LinkCrawlerQueue, OpenAIQueue, SearchIndexingQueue, + triggerSearchReindex, } from "@hoarder/shared/queues"; import { adminProcedure, router } from "../index"; @@ -129,13 +130,6 @@ export const adminAppRouter = router({ }, }); - await Promise.all( - bookmarkIds.map((b) => - SearchIndexingQueue.add("search_indexing", { - bookmarkId: b.id, - type: "index", - }), - ), - ); + await Promise.all(bookmarkIds.map((b) => triggerSearchReindex(b.id))); }), }); -- cgit v1.2.3-70-g09d2