moar unit test !
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 6m9s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 6m9s
This commit is contained in:
@@ -96,12 +96,11 @@ interface CleanupJobData {
|
||||
}
|
||||
|
||||
/**
|
||||
* The main worker process for handling flyer jobs.
|
||||
* This should be run as a separate process.
|
||||
* Processor function for the flyer-processing queue.
|
||||
* This is exported for testability.
|
||||
* @param job The job to process.
|
||||
*/
|
||||
export const flyerWorker = new Worker<FlyerJobData>(
|
||||
'flyer-processing',
|
||||
async (job: Job<FlyerJobData>) => {
|
||||
export const flyerWorkerProcessor = async (job: Job<FlyerJobData>) => {
|
||||
const { filePath, originalFileName, checksum, userId, submitterIp, userProfileAddress } = job.data;
|
||||
const createdImagePaths: string[] = [];
|
||||
let jobSucceeded = false;
|
||||
@@ -226,7 +225,11 @@ export const flyerWorker = new Worker<FlyerJobData>(
|
||||
logger.warn(`[Worker] Job ${job.id} failed. Temporary files will not be cleaned up to allow for manual inspection.`);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export const flyerWorker = new Worker<FlyerJobData>(
|
||||
'flyer-processing',
|
||||
flyerWorkerProcessor,
|
||||
{
|
||||
connection,
|
||||
// Control the number of concurrent jobs. This directly limits parallel calls to the AI API.
|
||||
|
||||
Reference in New Issue
Block a user