Update task.sh

This commit is contained in:
Twinzo1 2021-06-14 14:59:27 +08:00 committed by GitHub
parent 75e199a460
commit 5122e9708a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,26 +106,15 @@ run_normal() {
local p1=$1 local p1=$1
cd $dir_scripts cd $dir_scripts
define_program "$p1" define_program "$p1"
if [[ $p1 == *.js ]]; then
if [[ $AutoHelpOther == true ]] && [[ $(ls $dir_code) ]]; then
local latest_log=$(ls -r $dir_code | head -1)
. $dir_code/$latest_log
fi
if [[ $# -eq 1 ]]; then
random_delay
fi
fi
combine_all combine_all
log_time=$(date "+%Y-%m-%d-%H-%M-%S") log_time=$(date "+%Y-%m-%d-%H-%M-%S")
log_dir_tmp="${p1##*/}" log_dir_tmp="${p1##*/}"
log_dir="$dir_log/${log_dir_tmp%%.*}" log_dir="$dir_log/${log_dir_tmp%%.*}"
log_path="$log_dir/$log_time.log" log_path="$log_dir/$log_time.log"
make_dir "$log_dir" make_dir "$log_dir"
local id=$(cat $list_crontab_user | grep -E "$cmd_task $p1$" | perl -pe "s|.*ID=(.*) $cmd_task $p1$|\1|" | xargs | sed 's/ /","/g') timeout $command_timeout_time ${dir_shell}/run_scripts.sh $p1 2>&1 | tee $log_path
update_cron_status "\"$id\"" "0"
timeout $command_timeout_time $which_program $p1 2>&1 | tee $log_path
update_cron_status "\"$id\"" "1"
} }
## 并发执行因为是并发所以日志只能直接记录在日志文件中日志文件以Cookie编号结尾前台执行并发跑时不会输出日志 ## 并发执行因为是并发所以日志只能直接记录在日志文件中日志文件以Cookie编号结尾前台执行并发跑时不会输出日志