added SOCKS5 proxy support
All checks were successful
Run Integration Tests / test (push) Successful in 33s

This commit is contained in:
partisan 2025-01-12 16:46:52 +01:00
parent 234f1dd3be
commit 614ce8903e
22 changed files with 501 additions and 106 deletions

View file

@ -10,7 +10,7 @@ import (
)
func PerformRedditSearch(query string, safe string, page int) ([]ForumSearchResult, error) {
if !config.CrawlerEnabled {
if !config.MetaSearchEnabled {
printDebug("Crawler is disabled; skipping forum search.")
return []ForumSearchResult{}, nil
}
@ -150,7 +150,7 @@ func getForumResultsFromCacheOrFetch(cacheKey CacheKey, query, safe, lang string
case results := <-cacheChan:
if results == nil {
// Fetch only if the cache miss occurs and Crawler is enabled
if config.CrawlerEnabled {
if config.MetaSearchEnabled {
combinedResults = fetchForumResults(query, safe, lang, page)
if len(combinedResults) > 0 {
resultsCache.Set(cacheKey, convertToSearchResults(combinedResults))
@ -164,7 +164,7 @@ func getForumResultsFromCacheOrFetch(cacheKey CacheKey, query, safe, lang string
}
case <-time.After(2 * time.Second):
printDebug("Cache check timeout")
if config.CrawlerEnabled {
if config.MetaSearchEnabled {
combinedResults = fetchForumResults(query, safe, lang, page)
if len(combinedResults) > 0 {
resultsCache.Set(cacheKey, convertToSearchResults(combinedResults))