added ProxyRetry to config and fixed ProxyStrict
Some checks failed
Run Integration Tests / test (push) Failing after 50s
Some checks failed
Run Integration Tests / test (push) Failing after 50s
This commit is contained in:
parent
ab707a91e8
commit
35e657bccd
17 changed files with 224 additions and 186 deletions
|
@ -44,17 +44,9 @@ func PerformLibreXTextSearch(query, safe, lang string, page int) ([]TextSearchRe
|
|||
}
|
||||
req.Header.Set("User-Agent", userAgent)
|
||||
|
||||
// Respect MetaProxy if enabled and strict
|
||||
var resp *http.Response
|
||||
if config.MetaProxyEnabled && config.MetaProxyStrict && metaProxyClient != nil {
|
||||
resp, err = metaProxyClient.Do(req)
|
||||
} else {
|
||||
client := &http.Client{}
|
||||
resp, err = client.Do(req)
|
||||
}
|
||||
resp, err := DoMetaProxyRequest(req)
|
||||
if err != nil {
|
||||
printWarn("error requesting domain %s: %v", domain, err)
|
||||
continue
|
||||
return nil, 0, fmt.Errorf("failed to do meta-request: %v", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue