diff options
author | Erich Eckner <git@eckner.net> | 2019-06-28 09:44:08 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-06-28 09:44:08 +0200 |
commit | f0795d264728efadb32cf6485769bfcb12f81300 (patch) | |
tree | d087a219215c7bac904424d9c4c23af8985a859d /lib | |
parent | 81ce0f9e99e7a11202a907ba9773a424475fc101 (diff) | |
download | builder-f0795d264728efadb32cf6485769bfcb12f81300.tar.xz |
lib/load-configuration: skip logging for useless commands
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/load-configuration | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/lib/load-configuration b/lib/load-configuration index e434b4b..5513584 100755 --- a/lib/load-configuration +++ b/lib/load-configuration @@ -200,26 +200,31 @@ if [ "${master_build_server_identity}" = "${work_dir}/.ssh/id_rsa" ] && \ fi if ${i_am_the_master}; then - # shellcheck disable=SC2016 - { - printf 'INSERT INTO `command_log`(`command`,`parameters`,`shell`)' - printf ' VALUES (' - printf 'from_base64("%s"),' \ - "$( - printf '%s' "${0##*/}" | \ - base64 - )" - printf 'from_base64("%s"),' \ - "$( - printf '%s' "$*" | \ - base64 - )" - if tty -s; then - printf '1' - else - printf '0' - fi - printf ');\n' - } | \ - mysql_run_query 'unimportant' + command="${0##*/}" + # these commands are useless to log + if [ "${command}" != 'slave-build-connect' ] && \ + [ "${command}" != 'ping-from-slave' ]; then + # shellcheck disable=SC2016 + { + printf 'INSERT INTO `command_log`(`command`,`parameters`,`shell`)' + printf ' VALUES (' + printf 'from_base64("%s"),' \ + "$( + printf '%s' "${command}" | \ + base64 + )" + printf 'from_base64("%s"),' \ + "$( + printf '%s' "$*" | \ + base64 + )" + if tty -s; then + printf '1' + else + printf '0' + fi + printf ');\n' + } | \ + mysql_run_query 'unimportant' + fi fi |