添加最后运行时间和运行时长

This commit is contained in:
hanhh
2021-09-23 13:42:32 +08:00
parent c15ff89746
commit af2f3deeab
6 changed files with 124 additions and 14 deletions
+3 -1
View File
@@ -153,6 +153,8 @@ update_cron() {
local status="$2"
local pid="${3:-''}"
local logPath="$4"
local lastExecutingTime="$5"
local runningTime="$6"
local currentTimeStamp=$(date +%s)
local api=$(
curl -s --noproxy "*" "http://0.0.0.0:5600/api/crons/status?t=$currentTimeStamp" \
@@ -164,7 +166,7 @@ update_cron() {
-H "Origin: http://0.0.0.0:5700" \
-H "Referer: http://0.0.0.0:5700/crontab" \
-H "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7" \
--data-raw "{\"ids\":[$ids],\"status\":\"$status\",\"pid\":\"$pid\",\"log_path\":\"$logPath\"}" \
--data-raw "{\"ids\":[$ids],\"status\":\"$status\",\"pid\":\"$pid\",\"log_path\":\"$logPath\",\"last_execution_time\":\"$lastExecutingTime\",\"last_running_time\":\"$runningTime\"}" \
--compressed
)
code=$(echo $api | jq -r .code)