aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/trpc/routers/admin.ts41
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,
+ },
+ ),
),
);
}),