Merge pull request #4875 from nonamethanks/lofter-timeout

Lofter: raise timeout for file download
This commit is contained in:
evazion
2021-09-14 04:09:12 -05:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -235,9 +235,14 @@ module Sources
end
memoize :http
# The http timeout to download a file. Overrideable by each site
def download_timeout
30
end
# A http client for downloading files.
def http_downloader
http.timeout(30).max_size(Danbooru.config.max_file_size).use(:spoof_referrer).use(:unpolish_cloudflare)
http.timeout(download_timeout).max_size(Danbooru.config.max_file_size).use(:spoof_referrer).use(:unpolish_cloudflare)
end
memoize :http_downloader

View File

@@ -96,6 +96,10 @@ module Sources
def artist_name
urls.map { |u| u[PROFILE_URL, :artist_name] || u[PAGE_URL, :artist_name] }.compact.first
end
def download_timeout
60
end
end
end
end