mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-13 14:37:28 +08:00
修复获取任务退出码
This commit is contained in:
parent
34d4526413
commit
23b41893a3
|
|
@ -373,4 +373,4 @@ if [[ $isJsOrPythonFile == 'true' ]]; then
|
||||||
fi
|
fi
|
||||||
run_task_after "${task_shell_params[@]}"
|
run_task_after "${task_shell_params[@]}"
|
||||||
clear_env
|
clear_env
|
||||||
handle_task_end "${task_shell_params[@]}" "$_task_exit_code"
|
handle_task_end "${task_shell_params[@]}"
|
||||||
|
|
|
||||||
|
|
@ -388,7 +388,7 @@ handle_task_end() {
|
||||||
local end_time=$(format_time "$time_format" "$etime")
|
local end_time=$(format_time "$time_format" "$etime")
|
||||||
local end_timestamp=$(format_timestamp "$time_format" "$etime")
|
local end_timestamp=$(format_timestamp "$time_format" "$etime")
|
||||||
local diff_time=$(($end_timestamp - $begin_timestamp))
|
local diff_time=$(($end_timestamp - $begin_timestamp))
|
||||||
local exit_code="${@: -1}"
|
local exit_code="${_task_exit_code:-0}"
|
||||||
[[ "$diff_time" == 0 ]] && diff_time=1
|
[[ "$diff_time" == 0 ]] && diff_time=1
|
||||||
|
|
||||||
if [[ $ID ]]; then
|
if [[ $ID ]]; then
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@ dir_shell=$QL_DIR/shell
|
||||||
|
|
||||||
trap "single_hanle" 2 3 20 15 14 19 1
|
trap "single_hanle" 2 3 20 15 14 19 1
|
||||||
single_hanle() {
|
single_hanle() {
|
||||||
eval MANUAL=true handle_task_end "$@" "$cmd"
|
_task_exit_code="${_task_exit_code:-$?}"
|
||||||
|
[[ "$_task_exit_code" == "0" ]] && _task_exit_code="1"
|
||||||
|
eval MANUAL=true handle_task_end "$@"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user