mirror of
https://github.com/neocities/neocities.git
synced 2025-05-16 09:27:20 +02:00
Use http.rb to ensure timeout enforcement for cache purging, disable crashing flag for now
This commit is contained in:
parent
c3ea1fc9e4
commit
80b3f6b0be
3 changed files with 11 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue