1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-12-02 20:22:52 +00:00

default timeout

This commit is contained in:
Laura
2025-10-25 15:32:10 +02:00
parent 61f0d00bfa
commit 9fa1c29365
2 changed files with 6 additions and 7 deletions

View File

@@ -14,19 +14,13 @@ func init() {
}
func OpenRouterClient() *openrouter.Client {
timeout := env.Settings.Timeout
if timeout <= 0 {
timeout = 1
}
cc := openrouter.DefaultConfig(env.Tokens.OpenRouter)
cc.XTitle = "Whiskr"
cc.HttpReferer = "https://github.com/coalaura/whiskr"
cc.HTTPClient = &http.Client{
Timeout: time.Duration(timeout) * time.Second,
Timeout: time.Duration(env.Settings.Timeout) * time.Second,
}
return openrouter.NewClientWithConfig(*cc)