Skip to content

Commit

Permalink
Tune Tesseract & Sidekiq to (hopefully) prevent locks
Browse files Browse the repository at this point in the history
  • Loading branch information
DanOlson committed Dec 17, 2021
1 parent 87c11b2 commit 96df0f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/sidekiq.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
:verbose: false
:concurrency: 5 # Sidekiq default
:concurrency: 4
:timeout: 25

# Sidekiq will run this file through ERB when reading it so you can
Expand Down
3 changes: 2 additions & 1 deletion lib/mdl/process_document_for_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ def manifest_uri

def run_ocr_on(candidate)
log("Running OCR for canvas #{candidate.canvas_id}")
env = { 'OMP_THREAD_LIMIT' => '1' }
command = "tesseract #{candidate.image_file.path} #{candidate.ocr_temp_file_path} -l eng hocr"
_output, error, status = Open3.capture3(command)
_output, error, status = Open3.capture3(env, command)
if status.success?
log("OCR successful for image on canvas #{candidate.canvas_id}")
else
Expand Down

0 comments on commit 96df0f9

Please sign in to comment.