Skip to content

Commit 73035d2

Browse files
committed
Retry remote server health checks
1 parent 03217dc commit 73035d2

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

cmd/subrouter/cx_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func (r cxRunner) serverInstall(ctx context.Context, store cxServerStore, args [
302302
"curl -fsSL " + shellQuote(publicInstallScriptURL) + " | sudo env SUBROUTER_VERSION=" + shellQuote(*version) + " sh",
303303
"sudo /usr/local/bin/sr install-systemd --addr " + shellQuote(*addr) + " --cx-switch-interval " + shellQuote(*cxSwitchInterval) + " --extra-args " + shellQuote(*extraArgs),
304304
"if [ -n \"$tailscale_auth_key\" ]; then sudo tailscale up --auth-key \"$tailscale_auth_key\" --hostname " + shellQuote(hostname) + " --ssh --accept-routes=false --accept-dns=false; fi",
305-
"curl -fsS http://127.0.0.1:31415/_subrouter/health >/dev/null",
305+
"i=0; until curl -fsS http://127.0.0.1:31415/_subrouter/health >/dev/null; do i=$((i+1)); if [ \"$i\" -ge 30 ]; then exit 1; fi; sleep 1; done",
306306
"/usr/local/bin/sr --help >/dev/null",
307307
}, "\n")
308308
sshArgs := []string{"compute", "ssh", server.GCPInstance, "--zone", server.GCPZone, "--command", remoteCommand}

cmd/subrouter/cx_server_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ func TestCXServerInstallUsesPublicInstallerAndSystemdCommand(t *testing.T) {
142142
publicInstallScriptURL,
143143
"SUBROUTER_VERSION='0.1.2'",
144144
"/usr/local/bin/sr install-systemd",
145+
"until curl -fsS http://127.0.0.1:31415/_subrouter/health",
145146
"tailscale up",
146147
} {
147148
if !strings.Contains(installCommand, want) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "subrouter",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Routes AI coding-agent traffic across subscription accounts and API keys.",
55
"license": "MIT",
66
"homepage": "https://github.com/manaflow-ai/subrouter#readme",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "subrouter"
7-
version = "0.1.3"
7+
version = "0.1.4"
88
description = "Routes AI coding-agent traffic across subscription accounts and API keys."
99
readme = "README.md"
1010
requires-python = ">=3.9"

subrouter_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import urllib.request
1010
from pathlib import Path
1111

12-
VERSION = "0.1.3"
12+
VERSION = "0.1.4"
1313

1414

1515
def _go_platform() -> str:

0 commit comments

Comments
 (0)