refactor(ocr): remove subprocess mode — HTTP only

- ocr.js: Removed all subprocess/spawn logic (spawn, fs, path, process
  imports, resolveWorkerCommand, buildPythonPath, buildWorkerError,
  callOcrViaSubprocess, resolveOcrMode, runOcrCommand, etc.)
  HTTP is now the only mode. Added validation when OCR_BASE_URL is not
  configured. ~281 lines → ~80 lines.
- default.cjs: Removed projectRoot from ocr config (kept path import
  for data.root)
- runtime.js: Removed OCR_PROJECT_ROOT env var parsing
- runtime-config.js: Removed projectRoot from ocr type definition

All 5 exports preserved: recognizeTencentCaptcha,
recognizeImageCaptcha, batchRecognizeTencentCaptcha,
warmupLocalOcrWorker, closeLocalOcrWorker
This commit is contained in:
yml
2026-05-19 23:29:42 +08:00
parent 2ecf4691d0
commit e812ea2cc4
4 changed files with 17 additions and 215 deletions
-1
View File
@@ -19,7 +19,6 @@ module.exports = {
},
ocr: {
projectRoot: path.resolve(__dirname, '../subservices/ocr-worker'),
baseUrl: '',
},