mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-02 12:01:50 +08:00
fix: address Jev judge review round 2
This commit is contained in:
1 parent
9a1599b96e
commit
e47f7892dd
6 files changed
+90
-27
No files matched your search
+3
-1
@@ -1580,7 +1580,9 @@ func (s *Server) testLLM(w http.ResponseWriter, r *http.Request) {
|
||||
proxy = p.Proxy
|
||||
}
|
||||
}
|
||||
lat, reply, err := (jev.Config{BaseURL: baseURL, APIKey: apiKey, Model: model, Proxy: proxy}).TestConnection(r.Context())
|
||||
testCtx, cancel := context.WithTimeout(r.Context(), 30*time.Second)
|
||||
defer cancel()
|
||||
lat, reply, err := (jev.Config{BaseURL: baseURL, APIKey: apiKey, Model: model, Proxy: proxy}).TestConnection(testCtx)
|
||||
if err != nil {
|
||||
writeJSON(w, 200, map[string]any{"ok": false, "error": err.Error()})
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user