mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 03:46:07 +08:00
修复并发参数
This commit is contained in:
parent
da3e63e6c3
commit
be4efbad5d
|
@ -90,15 +90,15 @@ export default class CronService {
|
||||||
status,
|
status,
|
||||||
pid,
|
pid,
|
||||||
log_path,
|
log_path,
|
||||||
last_running_time,
|
last_running_time = 0,
|
||||||
last_execution_time,
|
last_execution_time = 0,
|
||||||
}: {
|
}: {
|
||||||
ids: string[];
|
ids: string[];
|
||||||
status: CrontabStatus;
|
status: CrontabStatus;
|
||||||
pid: number;
|
pid: number;
|
||||||
log_path: string;
|
log_path: string;
|
||||||
last_running_time: string;
|
last_running_time: number;
|
||||||
last_execution_time: string;
|
last_execution_time: number;
|
||||||
}) {
|
}) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.cronDb.update(
|
this.cronDb.update(
|
||||||
|
|
|
@ -153,8 +153,8 @@ update_cron() {
|
||||||
local status="$2"
|
local status="$2"
|
||||||
local pid="${3:-''}"
|
local pid="${3:-''}"
|
||||||
local logPath="$4"
|
local logPath="$4"
|
||||||
local lastExecutingTime="${5:-''}"
|
local lastExecutingTime="${5:-0}"
|
||||||
local runningTime="${6:-''}"
|
local runningTime="${6:-0}"
|
||||||
local currentTimeStamp=$(date +%s)
|
local currentTimeStamp=$(date +%s)
|
||||||
local api=$(
|
local api=$(
|
||||||
curl -s --noproxy "*" "http://0.0.0.0:5600/api/crons/status?t=$currentTimeStamp" \
|
curl -s --noproxy "*" "http://0.0.0.0:5600/api/crons/status?t=$currentTimeStamp" \
|
||||||
|
@ -166,7 +166,7 @@ update_cron() {
|
||||||
-H "Origin: http://0.0.0.0:5700" \
|
-H "Origin: http://0.0.0.0:5700" \
|
||||||
-H "Referer: http://0.0.0.0:5700/crontab" \
|
-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" \
|
-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\",\"last_execution_time\":\"$lastExecutingTime\",\"last_running_time\":\"$runningTime\"}" \
|
--data-raw "{\"ids\":[$ids],\"status\":\"$status\",\"pid\":\"$pid\",\"log_path\":\"$logPath\",\"last_execution_time\":$lastExecutingTime,\"last_running_time\":$runningTime}" \
|
||||||
--compressed
|
--compressed
|
||||||
)
|
)
|
||||||
code=$(echo $api | jq -r .code)
|
code=$(echo $api | jq -r .code)
|
||||||
|
|
|
@ -113,8 +113,8 @@ run_normal() {
|
||||||
|
|
||||||
## 并发执行时,设定的 RandomDelay 不会生效,即所有任务立即执行
|
## 并发执行时,设定的 RandomDelay 不会生效,即所有任务立即执行
|
||||||
run_concurrent() {
|
run_concurrent() {
|
||||||
local first_param=$1
|
local first_param="$1"
|
||||||
local third_param=$3
|
local third_param="$2"
|
||||||
if [[ ! $third_param ]]; then
|
if [[ ! $third_param ]]; then
|
||||||
echo -e "\n 缺少并发运行的环境变量参数"
|
echo -e "\n 缺少并发运行的环境变量参数"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user