feat(jobs): blob worker fans out to extract.pdf / extract.image
After creating a ref, the Node-side ingest.blob worker enqueues a follow-up job for the Python void-workers (Plan 4) to OCR / extract text. Other kinds (file) get no follow-up. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import * as refs from '../../db/repos/refs.js';
|
||||
import { defaultStore } from '../../ingest/blob_store.js';
|
||||
import * as queue from '../queue.js';
|
||||
|
||||
export const NAME = 'ingest.blob';
|
||||
|
||||
@@ -27,5 +28,12 @@ export async function handler(job) {
|
||||
blob_path: path,
|
||||
metadata: { sha, content_type, filename, size: buf.length, ...(meta.metadata || {}) }
|
||||
}, { kind: 'system', id: null });
|
||||
|
||||
// Plan 4: hand off to the Python void-workers for OCR / extraction.
|
||||
if (kind === 'pdf') {
|
||||
await queue.enqueue('extract.pdf', { ref_id: row.id, blob_path: path });
|
||||
} else if (kind === 'image') {
|
||||
await queue.enqueue('extract.image', { ref_id: row.id, blob_path: path });
|
||||
}
|
||||
return { ref_id: row.id, sha };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user