1
0
Fork 0

Add timeout

main v0.12.4
Jordan Hotmann 2023-11-27 17:47:07 -07:00
parent b213dce11f
commit d4d35482ab
No known key found for this signature in database
GPG Key ID: 01B504170C2A2EA3
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"net/http" "net/http"
"os" "os"
"strings" "strings"
"time"
"code.jhot.me/jhot/hats/internal/util" "code.jhot.me/jhot/hats/internal/util"
"github.com/go-resty/resty/v2" "github.com/go-resty/resty/v2"
@ -16,7 +17,7 @@ type QbittorrentClient struct {
func New(host string) *QbittorrentClient { func New(host string) *QbittorrentClient {
return &QbittorrentClient{ return &QbittorrentClient{
restClient: resty.New().SetBaseURL(fmt.Sprintf("%s/api/v2", host)), restClient: resty.New().SetTimeout(30 * time.Second).SetBaseURL(fmt.Sprintf("%s/api/v2", host)),
} }
} }