fix(ci): install docker heartbeat traps before launch · openclaw/openclaw@25bd8a7
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,8 +42,7 @@ run_logged_print_heartbeat() {
|
42 | 42 | fi |
43 | 43 | local log_file |
44 | 44 | log_file="$(docker_e2e_run_log "$label")" |
45 | | -"$@" >"$log_file" 2>&1 & |
46 | | -local command_pid=$! |
| 45 | +local command_pid="" |
47 | 46 | local cleanup_done=0 |
48 | 47 | local previous_int_trap |
49 | 48 | local previous_term_trap |
@@ -52,6 +51,9 @@ run_logged_print_heartbeat() {
|
52 | 51 | previous_term_trap="$(trap -p TERM || true)" |
53 | 52 | previous_hup_trap="$(trap -p HUP || true)" |
54 | 53 | terminate_heartbeat_command() { |
| 54 | +if [ -z "$command_pid" ]; then |
| 55 | +return 0 |
| 56 | +fi |
55 | 57 | kill -TERM "$command_pid" 2>/dev/null || true |
56 | 58 | local grace_seconds="${OPENCLAW_DOCKER_E2E_HEARTBEAT_TERM_GRACE_SECONDS:-30}" |
57 | 59 | if ! [[ "$grace_seconds" =~ ^[0-9]+$ ]] || [ "$grace_seconds" -lt 1 ]; then |
@@ -106,6 +108,8 @@ run_logged_print_heartbeat() {
|
106 | 108 | trap 'cleanup_heartbeat_command 130' INT |
107 | 109 | trap 'cleanup_heartbeat_command 143' TERM |
108 | 110 | trap 'cleanup_heartbeat_command 129' HUP |
| 111 | +"$@" >"$log_file" 2>&1 & |
| 112 | + command_pid=$! |
109 | 113 | local started_at="$SECONDS" |
110 | 114 | local next_heartbeat=$interval_seconds |
111 | 115 | local status=0 |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。