move stats to check task

This commit is contained in:
Felix Lohmeier 2022-04-06 21:21:42 +02:00 committed by GitHub
parent 5794f3cee0
commit 0691b1f5e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -50,16 +50,18 @@ tasks:
--output output/deduped.tsv
check:
- | # print stats
PID="$(lsof -t -i:${OPENREFINE_PORT})"
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM"
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time"
- | # check log file for any warnings
if grep -i 'exception\|error' "${OPENREFINE_TMPDIR}/log.txt"
then echo 1>&2 "log contains warnings!"; echo; cat "${OPENREFINE_TMPDIR}/log.txt"; exit 1
fi
cleanup:
- | # print stats and kill OpenRefine immediately
- | # kill OpenRefine immediately
PID="$(lsof -t -i:${OPENREFINE_PORT})"
echo "used $(($(ps --no-headers -o rss -p "$PID") / 1024)) MB RAM"
echo "used $(ps --no-headers -o cputime -p "$PID") CPU time"
kill -9 $PID
- | # delete temporary files
rm -rf "${OPENREFINE_TMPDIR}"