重构六位定时任务服务

This commit is contained in:
whyour
2023-04-08 17:07:06 +08:00
parent 59c26d90d3
commit 6fb39ce835
13 changed files with 854 additions and 68 deletions
+3 -1
View File
@@ -30,7 +30,7 @@ random_delay() {
done
local delay_second=$(($(gen_random_num "$random_delay_max") + 1))
echo -e "\n命令未添加 \"now\"随机延迟 $delay_second后执行\n"
echo -e "任务随机延迟 $delay_second,配置文件参数 RandomDelay 置空可取消延迟 \n"
sleep $delay_second
fi
}
@@ -119,6 +119,8 @@ handle_task_after() {
local end_timestamp=$(format_timestamp "$time_format" "$etime")
local diff_time=$(($end_timestamp - $begin_timestamp))
[[ "$diff_time" == 0 ]] && diff_time=1
echo -e "\n\n## 执行结束... $end_time 耗时 $diff_time 秒     "
[[ $ID ]] && update_cron "\"$ID\"" "1" "" "$log_path" "$begin_timestamp" "$diff_time"