mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-15 11:03:01 +08:00
修改 task 日志展示逻辑
This commit is contained in:
@@ -502,7 +502,7 @@ export default class CronService {
|
|||||||
if (!command.startsWith(TASK_PREFIX) && !command.startsWith(QL_PREFIX)) {
|
if (!command.startsWith(TASK_PREFIX) && !command.startsWith(QL_PREFIX)) {
|
||||||
command = `${TASK_PREFIX}${tab.command}`;
|
command = `${TASK_PREFIX}${tab.command}`;
|
||||||
}
|
}
|
||||||
let commandVariable = `ID=${tab.id} `
|
let commandVariable = `no_tee=true ID=${tab.id} `
|
||||||
if (tab.task_before) {
|
if (tab.task_before) {
|
||||||
commandVariable += `task_before='${tab.task_before.replace(/'/g, "'\\''")
|
commandVariable += `task_before='${tab.task_before.replace(/'/g, "'\\''")
|
||||||
.trim()}' `;
|
.trim()}' `;
|
||||||
|
|||||||
+3
-6
@@ -70,10 +70,10 @@ handle_log_path() {
|
|||||||
log_path="$real_log_path"
|
log_path="$real_log_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmd=">> $dir_log/$log_path 2>&1"
|
|
||||||
make_dir "$dir_log/$log_dir"
|
|
||||||
if [[ "$show_log" == "true" ]]; then
|
|
||||||
cmd="2>&1 | tee -a $dir_log/$log_path"
|
cmd="2>&1 | tee -a $dir_log/$log_path"
|
||||||
|
make_dir "$dir_log/$log_dir"
|
||||||
|
if [[ "$no_tee" == "true" ]]; then
|
||||||
|
cmd=">> $dir_log/$log_path 2>&1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$real_time" == "true" ]]; then
|
if [[ "$real_time" == "true" ]]; then
|
||||||
@@ -139,7 +139,4 @@ handle_log_path "${task_shell_params[@]}"
|
|||||||
init_begin_time
|
init_begin_time
|
||||||
|
|
||||||
eval . $dir_shell/otask.sh "$cmd"
|
eval . $dir_shell/otask.sh "$cmd"
|
||||||
# mac cat 无法正常退出
|
|
||||||
# [[ -f "$dir_log/$log_path" ]] && [[ ! $show_log ]] && [[ "$real_time" != "true" ]] && cat "$dir_log/$log_path"
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user