File size: 968 Bytes
68e2686 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #!/bin/bash
# teaser · 世界编辑:推完的 case 逐条补 edit_sheet.jpg / edit_score.json(CPU),每 90 s 扫一次;touch <OUT>/post.stop 停。
# usage: nohup bash scripts/teaser/edit_post_loop.sh [OUT=outputs/teaser/edit/e81] > outputs/teaser/logs/edit/post_loop.log 2>&1 &
M=/opt/dlami/nvme/zhiyangdeng/maliang
OUT=${1:-$M/outputs/teaser/edit/e81}
cd $M
export PYTHONPATH=$M/code/gc25d
while [ ! -f $OUT/post.stop ]; do
ls -d $OUT/cases/*/ 2>/dev/null | while read c; do
[ -f $c/meta.json ] && { [ ! -f $c/edit_score.json ] || [ ! -f $c/edit_sheet.jpg ]; } && echo $c
done > $OUT/.post_todo
n=$(wc -l < $OUT/.post_todo)
if [ "$n" -gt 0 ]; then
cat $OUT/.post_todo | xargs -P 24 -n 4 .venv/bin/python scripts/teaser/compose_edit.py score --procs 1 > /dev/null 2>&1
cat $OUT/.post_todo | xargs -P 24 -n 4 .venv/bin/python scripts/teaser/compose_edit.py sheet > /dev/null 2>&1
echo "$(date +%H:%M:%S) post $n"
fi
sleep 90
done
|