Fix api client
This commit is contained in:
@@ -60,7 +60,7 @@ func NewHTTPClient(
|
||||
) *HTTPClient {
|
||||
client := HTTPClient{
|
||||
bearerToken: token,
|
||||
client: http.DefaultClient,
|
||||
client: &http.Client{},
|
||||
maxRetries: maxRetries,
|
||||
timeoutSecs: timeoutSecs,
|
||||
backoff: backoffFunc,
|
||||
|
||||
@@ -175,7 +175,7 @@ func (rd *RealDebrid) GetTorrents(onlyOne bool) ([]Torrent, int, error) {
|
||||
// compute ceiling of totalCount / limit
|
||||
maxPages := (totalCount + rd.cfg.GetTorrentsCount() - 1) / rd.cfg.GetTorrentsCount()
|
||||
rd.log.Debugf("Torrents total count is %d, max pages is %d", totalCount, maxPages)
|
||||
maxParallelThreads := 2
|
||||
maxParallelThreads := 4
|
||||
if maxPages < maxParallelThreads {
|
||||
maxParallelThreads = maxPages
|
||||
}
|
||||
@@ -194,7 +194,7 @@ func (rd *RealDebrid) GetTorrents(onlyOne bool) ([]Torrent, int, error) {
|
||||
for i := 0; i < maxParallelThreads; i++ {
|
||||
res := <-allResults
|
||||
if res.err != nil {
|
||||
return nil, 0, res.err
|
||||
continue
|
||||
}
|
||||
allTorrents = append(allTorrents, res.torrents...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user