修改 task 命令超时时间判断

This commit is contained in:
whyour 2023-05-01 11:05:36 +08:00
parent 1f8f35476a
commit df1addc1ff

View File

@ -34,7 +34,7 @@ define_program() {
handle_log_path() {
local file_param=$1
if [[ -z $file_param ]];then
if [[ -z $file_param ]]; then
file_param="task"
fi
@ -76,8 +76,10 @@ format_params() {
mtime_format="%Y-%m-%d %H:%M:%S.%3N"
fi
timeoutCmd=""
if type timeout &>/dev/null; then
timeoutCmd="timeout --foreground -s 2 -k 10s $command_timeout_time "
if [[ $command_timeout_time ]]; then
if type timeout &>/dev/null; then
timeoutCmd="timeout --foreground -s 2 -k 10s $command_timeout_time "
fi
fi
# params=$(echo "$@" | sed -E 's/([^ ])&([^ ])/\1\\\&\2/g')
}