aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2024-12-25 23:53:46 +0000
committerMohamed Bassem <me@mbassem.com>2024-12-26 00:11:19 +0000
commit9a950e1068a7309d0cb36ffd33ecd2cd0af5c004 (patch)
tree93af30d9aee26995350aaa029f86a8d2abf722d4 /packages/shared
parent86a4030c5fcbe2cb6ecaa0bd17136f950af34260 (diff)
downloadkarakeep-9a950e1068a7309d0cb36ffd33ecd2cd0af5c004.tar.zst
refactor: Move asset preprocessing to its own worker out of the inference worker
Diffstat (limited to 'packages/shared')
-rw-r--r--packages/shared/queues.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/shared/queues.ts b/packages/shared/queues.ts
index a887417d..7afb8774 100644
--- a/packages/shared/queues.ts
+++ b/packages/shared/queues.ts
@@ -139,3 +139,22 @@ export const FeedQueue = new SqliteQueue<ZFeedRequestSchema>(
keepFailedJobs: false,
},
);
+
+// Preprocess Assets
+export const zAssetPreprocessingRequestSchema = z.object({
+ bookmarkId: z.string(),
+});
+export type AssetPreprocessingRequest = z.infer<
+ typeof zAssetPreprocessingRequestSchema
+>;
+export const AssetPreprocessingQueue =
+ new SqliteQueue<AssetPreprocessingRequest>(
+ "asset_preprocessing_queue",
+ queueDB,
+ {
+ defaultJobArgs: {
+ numRetries: 2,
+ },
+ keepFailedJobs: false,
+ },
+ );