Skip to content

Commit

Permalink
kill child pids on ctrl-c
Browse files Browse the repository at this point in the history
  • Loading branch information
cldellow committed Oct 5, 2024
1 parent 6c90784 commit c8462b7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tile-smush-parallel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ set -euo pipefail
rm -f merged.mbtiles*

pids=()

kill_children() {
for pid in ${pids[*]}; do
kill $pid
done
}

trap kill_children INT

export SHARDS=16
for i in $(seq 0 $((SHARDS - 1))); do
SHARD=$i ./tile-smush "$@" &
Expand Down

0 comments on commit c8462b7

Please sign in to comment.