添加ql check运行环境监测

This commit is contained in:
hanhh
2021-06-29 00:05:37 +08:00
parent 1a801c2d31
commit c77eb3d28d
6 changed files with 124 additions and 47 deletions
+4 -4
View File
@@ -90,14 +90,14 @@ run_normal() {
local id=$(cat $list_crontab_user | grep -E "$cmd_task $p1$" | perl -pe "s|.*ID=(.*) $cmd_task $p1$|\1|" | xargs | sed 's/ /","/g')
local begin_time=$(date '+%Y-%m-%d %H:%M:%S')
echo -e "## 开始执行... $begin_time\n" >> $log_path
update_cron_status "\"$id\"" "0"
echo -e "## 开始执行... $begin_time\n" | tee -a $log_path
[[ $id ]] && update_cron_status "\"$id\"" "0"
timeout $command_timeout_time $which_program $p1 2>&1 | tee -a $log_path
. $file_task_after
update_cron_status "\"$id\"" "1"
[[ $id ]] && update_cron_status "\"$id\"" "1"
local end_time=$(date '+%Y-%m-%d %H:%M:%S')
local diff_time=$(($(date +%s -d "$end_time") - $(date +%s -d "$begin_time")))
echo -e "\n## 执行结束... $end_time 耗时 $diff_time" >> $log_path
echo -e "\n## 执行结束... $end_time 耗时 $diff_time" | tee -a $log_path
}
## 并发执行时,设定的 RandomDelay 不会生效,即所有任务立即执行