From 459f67c431699e68bc7ba5aa7274be39098a5658 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 18 Jun 2020 00:57:51 -0500 Subject: [PATCH] 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. --- app/logical/iqdb_proxy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/logical/iqdb_proxy.rb b/app/logical/iqdb_proxy.rb index a61dd3c2c..67e27bd90 100644 --- a/app/logical/iqdb_proxy.rb +++ b/app/logical/iqdb_proxy.rb @@ -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)