restart workers on error

This commit is contained in:
mrfry 2022-12-12 20:41:51 +01:00
parent 0259cfe1a7
commit 16cd4d9d4b
4 changed files with 57 additions and 14 deletions

View file

@ -9,7 +9,7 @@ import utils from './utils'
import { isMainThread, workerData } from 'worker_threads'
let recognizeCount = 0
const MAX_ALLOWED_RECOGNIZE_COUNT = 100
const MAX_ALLOWED_RECOGNIZE_COUNT = 3000 // ~ 500 MB
// https://github.com/naptha/tesseract.js/blob/master/docs/api.md
let tesseractWorker: TesseractWorker = null