mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(podman): kill timed container launches
This commit is contained in:
@@ -38,7 +38,11 @@ fail() {
|
||||
|
||||
run_podman_detached() {
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
timeout "$PODMAN_RUN_TIMEOUT" podman run "$@"
|
||||
if timeout --kill-after=1s 1s true >/dev/null 2>&1; then
|
||||
timeout --kill-after=30s "$PODMAN_RUN_TIMEOUT" podman run "$@"
|
||||
else
|
||||
timeout "$PODMAN_RUN_TIMEOUT" podman run "$@"
|
||||
fi
|
||||
return
|
||||
fi
|
||||
podman run "$@"
|
||||
|
||||
@@ -153,6 +153,8 @@ describe("test-install-sh-docker", () => {
|
||||
expect(script).toContain('PODMAN_RUN_TIMEOUT="${OPENCLAW_PODMAN_RUN_TIMEOUT:-600s}"');
|
||||
expect(script).toContain("OPENCLAW_PODMAN_RUN_TIMEOUT|OPENCLAW_PODMAN_GATEWAY_HOST_PORT");
|
||||
expect(script).toContain("run_podman_detached()");
|
||||
expect(script).toContain("timeout --kill-after=1s 1s true");
|
||||
expect(script).toContain('timeout --kill-after=30s "$PODMAN_RUN_TIMEOUT" podman run "$@"');
|
||||
expect(script).toContain('timeout "$PODMAN_RUN_TIMEOUT" podman run "$@"');
|
||||
expect(script).toContain('podman run --pull="$PODMAN_PULL" --rm -it \\');
|
||||
expect(script).toContain('run_podman_detached --pull="$PODMAN_PULL" -d --replace \\');
|
||||
|
||||
Reference in New Issue
Block a user