diff options
| author | Mohamed Bassem <me@mbassem.com> | 2026-01-10 17:01:08 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2026-01-10 17:01:31 +0000 |
| commit | 9d15eef074f9c4d351a1f074c748909e562f5f3e (patch) | |
| tree | 09a2c59080fcb9eb42636a5a1e1bf5637d377b49 /packages/trpc/routers/admin.ts | |
| parent | f48e98e16ae588ee5004531bf9a5aed757ed3786 (diff) | |
| download | karakeep-9d15eef074f9c4d351a1f074c748909e562f5f3e.tar.zst | |
fix: depri mass admin actions
Diffstat (limited to 'packages/trpc/routers/admin.ts')
| -rw-r--r-- | packages/trpc/routers/admin.ts | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/packages/trpc/routers/admin.ts b/packages/trpc/routers/admin.ts index 31ecaedc..44a51cad 100644 --- a/packages/trpc/routers/admin.ts +++ b/packages/trpc/routers/admin.ts @@ -217,10 +217,15 @@ export const adminAppRouter = router({ await Promise.all( bookmarkIds.map((b) => - LinkCrawlerQueue.enqueue({ - bookmarkId: b.id, - runInference: input.runInference, - }), + LinkCrawlerQueue.enqueue( + { + bookmarkId: b.id, + runInference: input.runInference, + }, + { + priority: 50, + }, + ), ), ); }), @@ -233,7 +238,13 @@ export const adminAppRouter = router({ }, }); - await Promise.all(bookmarkIds.map((b) => triggerSearchReindex(b.id))); + await Promise.all( + bookmarkIds.map((b) => + triggerSearchReindex(b.id, { + priority: 50, + }), + ), + ); }), reprocessAssetsFixMode: adminProcedure.mutation(async ({ ctx }) => { const bookmarkIds = await ctx.db.query.bookmarkAssets.findMany({ @@ -244,10 +255,15 @@ export const adminAppRouter = router({ await Promise.all( bookmarkIds.map((b) => - AssetPreprocessingQueue.enqueue({ - bookmarkId: b.id, - fixMode: true, - }), + AssetPreprocessingQueue.enqueue( + { + bookmarkId: b.id, + fixMode: true, + }, + { + priority: 50, + }, + ), ), ); }), @@ -277,7 +293,12 @@ export const adminAppRouter = router({ await Promise.all( bookmarkIds.map((b) => - OpenAIQueue.enqueue({ bookmarkId: b.id, type: input.type }), + OpenAIQueue.enqueue( + { bookmarkId: b.id, type: input.type }, + { + priority: 50, + }, + ), ), ); }), |
