mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
fix(status): guard against empty serverId to avoid list-all-servers API calls (#2392)
When both server_id and server_name are missing from a connection record, serverId falls back to "". Passing "" to fetchHetznerStatus/fetchDoStatus constructs URLs like /v1/servers/ (list all), wasting rate-limit quota and sending auth tokens to the wrong endpoint. Early-return "unknown" instead. Agent: code-health Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
05f744e052
commit
d73027eed4
1 changed files with 3 additions and 0 deletions
|
|
@ -112,6 +112,9 @@ async function checkServerStatus(record: SpawnRecord): Promise<LiveState> {
|
|||
}
|
||||
|
||||
const serverId = conn.server_id || conn.server_name || "";
|
||||
if (!serverId) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
switch (conn.cloud) {
|
||||
case "hetzner": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue