From 9a950e1068a7309d0cb36ffd33ecd2cd0af5c004 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Wed, 25 Dec 2024 23:53:46 +0000 Subject: refactor: Move asset preprocessing to its own worker out of the inference worker --- packages/shared/queues.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'packages/shared') 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( keepFailedJobs: false, }, ); + +// Preprocess Assets +export const zAssetPreprocessingRequestSchema = z.object({ + bookmarkId: z.string(), +}); +export type AssetPreprocessingRequest = z.infer< + typeof zAssetPreprocessingRequestSchema +>; +export const AssetPreprocessingQueue = + new SqliteQueue( + "asset_preprocessing_queue", + queueDB, + { + defaultJobArgs: { + numRetries: 2, + }, + keepFailedJobs: false, + }, + ); -- cgit v1.2.3-70-g09d2