Fix Tesseract workerPath in Next.js standalone container, pool worker, and add timeout
This commit is contained in:
1 parent
99522b3e09
commit
739cbce042
2 files changed
+49
-9
No files matched your search
@@ -7,10 +7,11 @@ export async function POST(req: NextRequest) {
|
||||
const body = await req.json().catch(() => ({}));
|
||||
const limit = Math.min(parseInt(String(body.limit || '10'), 10) || 10, 50);
|
||||
|
||||
// Find image or PDF attachments that do not have extractedText yet
|
||||
// Find image or PDF attachments that do not have extractedText yet (skip tiny icons < 2 KB)
|
||||
const pendingAttachments = await prisma.attachment.findMany({
|
||||
where: {
|
||||
extractedText: null,
|
||||
sizeBytes: { gte: 2048 },
|
||||
OR: [
|
||||
{ mimeType: { startsWith: 'image/' } },
|
||||
{ mimeType: 'application/pdf' },
|
||||
|
||||
Reference in new issue
Block a user