fix(slurm): add default 30s timeout to HTTP client

Replaces http.DefaultClient with a client that has a 30s timeout to prevent indefinite hangs when the Slurm REST API is unresponsive.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
dailz
2026-04-10 09:25:35 +08:00
parent 1359730300
commit c070dd8abc
4 changed files with 13 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ func TestNewClient(t *testing.T) {
t.Errorf("expected UserAgent %q, got %q", DefaultUserAgent, client.UserAgent)
}
if client.client == nil {
t.Error("expected http.Client to be initialized (nil httpClient should default to http.DefaultClient)")
t.Error("expected http.Client to be initialized (nil httpClient should create a client with default timeout)")
}
_, err = NewClient("://invalid", nil)