fix(setup): kill timed image pulls when supported · openclaw/openclaw@35310dc
vincentkoc
·
2026-05-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -37,7 +37,11 @@ run_docker_build() {
|
37 | 37 | run_docker_pull() { |
38 | 38 | local image="$1" |
39 | 39 | if command -v timeout >/dev/null 2>&1; then |
40 | | - timeout "$DOCKER_PULL_TIMEOUT" docker pull "$image" |
| 40 | +if timeout --kill-after=1s 1s true >/dev/null 2>&1; then |
| 41 | + timeout --kill-after=30s "$DOCKER_PULL_TIMEOUT" docker pull "$image" |
| 42 | +else |
| 43 | + timeout "$DOCKER_PULL_TIMEOUT" docker pull "$image" |
| 44 | +fi |
41 | 45 | return |
42 | 46 | fi |
43 | 47 | docker pull "$image" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -47,7 +47,11 @@ fail() {
|
47 | 47 | run_podman_pull() { |
48 | 48 | local image="$1" |
49 | 49 | if command -v timeout >/dev/null 2>&1; then |
50 | | - timeout "$PODMAN_PULL_TIMEOUT" podman pull "$image" |
| 50 | +if timeout --kill-after=1s 1s true >/dev/null 2>&1; then |
| 51 | + timeout --kill-after=30s "$PODMAN_PULL_TIMEOUT" podman pull "$image" |
| 52 | +else |
| 53 | + timeout "$PODMAN_PULL_TIMEOUT" podman pull "$image" |
| 54 | +fi |
51 | 55 | return |
52 | 56 | fi |
53 | 57 | podman pull "$image" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -126,6 +126,8 @@ describe("test-install-sh-docker", () => {
|
126 | 126 | |
127 | 127 | expect(script).toContain('DOCKER_PULL_TIMEOUT="${OPENCLAW_DOCKER_SETUP_PULL_TIMEOUT:-600s}"'); |
128 | 128 | expect(script).toContain("run_docker_pull()"); |
| 129 | +expect(script).toContain("timeout --kill-after=1s 1s true"); |
| 130 | +expect(script).toContain('timeout --kill-after=30s "$DOCKER_PULL_TIMEOUT" docker pull "$image"'); |
129 | 131 | expect(script).toContain('timeout "$DOCKER_PULL_TIMEOUT" docker pull "$image"'); |
130 | 132 | expect(script).toContain('run_docker_pull "$IMAGE_NAME"'); |
131 | 133 | expect(script).not.toContain('docker pull "$IMAGE_NAME"'); |
@@ -138,6 +140,8 @@ describe("test-install-sh-docker", () => {
|
138 | 140 | 'PODMAN_PULL_TIMEOUT="${OPENCLAW_PODMAN_SETUP_PULL_TIMEOUT:-600s}"', |
139 | 141 | ); |
140 | 142 | expect(script).toContain("run_podman_pull()"); |
| 143 | +expect(script).toContain("timeout --kill-after=1s 1s true"); |
| 144 | +expect(script).toContain('timeout --kill-after=30s "$PODMAN_PULL_TIMEOUT" podman pull "$image"'); |
141 | 145 | expect(script).toContain('timeout "$PODMAN_PULL_TIMEOUT" podman pull "$image"'); |
142 | 146 | expect(script).toContain('run_podman_pull "$OPENCLAW_IMAGE"'); |
143 | 147 | expect(script).not.toContain('podman pull "$OPENCLAW_IMAGE"'); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。