iqdb: fix 599 timeout errors.
Increase timeout to 30 seconds when uploading files to IQDB. Previously we used the default timeout of 3 seconds, which could cause 599 timeout errors sometimes if the upload took too long.
This commit is contained in:
@@ -55,7 +55,7 @@ class IqdbProxy
|
||||
|
||||
file = HTTP::FormData::File.new(file) if file
|
||||
form = { file: file, url: url, limit: limit }.compact
|
||||
response = http.post("#{iqdbs_server}/similar", form: form)
|
||||
response = http.timeout(30).post("#{iqdbs_server}/similar", form: form)
|
||||
|
||||
raise Error, "IQDB error: #{response.status}" if response.status != 200
|
||||
raise Error, "IQDB error: #{response.parse["error"]}" if response.parse.is_a?(Hash)
|
||||
|
||||
Reference in New Issue
Block a user