Skip to content

Commit 14346e5

Browse files
committed
tesstrain: catch+handle SIGINT (to stop waiting on subjobs)
1 parent 6cbad17 commit 14346e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/training/tesstrain_utils.sh

+2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ phase_I_generate_image() {
314314
fi
315315

316316
local jobs=
317+
trap "kill $$" INT
317318
for font in "${FONTS[@]}"; do
318319
sleep 1
319320
test $(jobs -r | wc -l) -ge $par_factor && wait -n
@@ -444,6 +445,7 @@ phase_E_extract_features() {
444445
export TESSDATA_PREFIX=${TESSDATA_DIR}
445446
tlog "Using TESSDATA_PREFIX=${TESSDATA_PREFIX}"
446447
local jobs=
448+
trap "kill $$" INT
447449
for img_file in ${img_files}; do
448450
test $(jobs -r | wc -l) -ge $par_factor && wait -n
449451
run_command tesseract ${img_file} ${img_file%.*} \

0 commit comments

Comments
 (0)