Skip to content

Commit

Permalink
OCR persistence cache fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat committed Feb 15, 2025
1 parent e037856 commit bc10bd1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions collector/utils/OCRLoader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ const path = require("path");

class OCRLoader {
constructor() {
this.cacheDir = path.resolve(
process.env.STORAGE_DIR
? path.resolve(process.env.STORAGE_DIR, `models`, `tesseract`)
: path.resolve(__dirname, `../../../server/storage/models/tesseract`)
);
this.cacheDir =
process.env.NODE_ENV === "production"
? path.resolve("/storage/models/tesseract") // hardcoded to Render storage mount.
: path.resolve(__dirname, "../../../server/storage/models/tesseract");
}

log(text, ...args) {
Expand Down

0 comments on commit bc10bd1

Please sign in to comment.