Use http.rb to ensure timeout enforcement for cache purging, disable crashing flag for now

This commit is contained in:
Kyle Drake 2016-10-23 12:52:44 -05:00
parent c3ea1fc9e4
commit 80b3f6b0be
3 changed files with 11 additions and 16 deletions

View file

@ -23,12 +23,9 @@ class DeleteCacheWorker
"http://#{proxy_ip}/:cache/purge#{path}",
Addressable::URI::CharacterClasses::QUERY
)
begin
RestClient::Request.execute method: :get, url: url, timeout: HTTP_TIMEOUT, headers: {
host: URI::encode("#{username}.neocities.org")
}
rescue RestClient::ResourceNotFound
rescue RestClient::Forbidden
end
HTTP.timeout(read: 10, write: 10, connect: 2).
headers(host: URI::encode("#{username}.neocities.org")).
get(url)
end
end