mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 07:16:08 +08:00
修复 task 命令执行时参数引号丢失
This commit is contained in:
parent
444836975d
commit
ed259e8168
|
@ -420,7 +420,7 @@ export default class CronService {
|
||||||
);
|
);
|
||||||
cp.stderr.on('data', (data) => {
|
cp.stderr.on('data', (data) => {
|
||||||
if (logFileExist) {
|
if (logFileExist) {
|
||||||
fs.appendFileSync(`${absolutePath}`, `${data}`);
|
fs.appendFileSync(`${absolutePath}`, `${data.toString()}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cp.on('error', (err) => {
|
cp.on('error', (err) => {
|
||||||
|
|
|
@ -156,7 +156,7 @@ handle_task_after() {
|
||||||
local end_timestamp=$(date "+%s")
|
local end_timestamp=$(date "+%s")
|
||||||
local diff_time=$(($end_timestamp - $begin_timestamp))
|
local diff_time=$(($end_timestamp - $begin_timestamp))
|
||||||
[[ $ID ]] && update_cron "\"$ID\"" "1" "" "$log_path" "$begin_timestamp" "$diff_time"
|
[[ $ID ]] && update_cron "\"$ID\"" "1" "" "$log_path" "$begin_timestamp" "$diff_time"
|
||||||
eval echo -e "\\\n\#\# 执行结束... $end_time 耗时 $diff_time 秒" $cmd
|
eval echo -e "\\\n\\\n\#\# 执行结束... $end_time 耗时 $diff_time 秒" $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
## 正常运行单个脚本,$1:传入参数
|
## 正常运行单个脚本,$1:传入参数
|
||||||
|
@ -284,7 +284,9 @@ run_else() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
shift
|
shift
|
||||||
eval $timeoutCmd $which_program "$file_param" "$@" $cmd
|
|
||||||
|
local params=$(echo "$@" | sed 's/ /\" \"/g')
|
||||||
|
eval $timeoutCmd $which_program $file_param \"$params\" $cmd
|
||||||
|
|
||||||
handle_task_after "$@"
|
handle_task_after "$@"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user