From f4e19874dc0dbab4b7bf9e5f6085d39f75d83f7e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 25 May 2018 16:38:16 +0200 Subject: bin/ping-from-slave: save number of trials --- bin/ping-from-slave | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'bin/ping-from-slave') diff --git a/bin/ping-from-slave b/bin/ping-from-slave index 2ae9f7e..171661d 100755 --- a/bin/ping-from-slave +++ b/bin/ping-from-slave @@ -56,9 +56,22 @@ log_lines=$(cat) printf 'NULL' fi - printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \ + printf ', `build_slaves`.`trials`=' + if [ -n "${log_lines}" ]; then + printf 'from_base64("%s")' \ + "$( + printf '%s\n' "${log_lines}" | \ + wc -l | \ + base64 -w0 + )" + else + printf 'NULL' + fi + + printf ' WHERE `build_slaves`.`id`=from_base64("%s");\n' \ "$( - printf '%s' "${slave}" | \ + # shellcheck disable=SC2154 + printf '%s' "${slave_id}" | \ base64 -w0 )" } | \ -- cgit v1.2.3-70-g09d2