Merge pull request #4875 from nonamethanks/lofter-timeout
Lofter: raise timeout for file download
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user