Disable delete cache worker for the moment, we don't use it

This commit is contained in:
Kyle Drake 2017-01-13 20:07:31 +00:00
parent 7198e788d1
commit 154abfc167

View file

@ -6,7 +6,7 @@ require 'open-uri'
# It's some nginx bug. I'm not going to deal with it.
class DeleteCacheWorker
HTTP_TIMEOUT = 5
HTTP_TIMEOUT = 10
include Sidekiq::Worker
sidekiq_options queue: :deletecache, retry: 3, backtrace: false, average_scheduled_poll_interval: 1
@ -16,15 +16,17 @@ class DeleteCacheWorker
end
def perform(proxy_ip, username, path)
# DOES NOTHING RIGHT NOW SO WE JUST RETURN
return
# Must always have a forward slash
path = '/' + path if path[0] != '/'
url = Addressable::URI.encode_component(
"https://#{proxy_ip}/:cache/purge#{path}",
"http://#{proxy_ip}/:cache/purge#{path}",
Addressable::URI::CharacterClasses::QUERY
)
HTTP.timeout(read: 10, write: 10, connect: 2).
HTTP.follow.timeout(read: 10, write: 10, connect: 2).
headers(host: URI::encode("#{username}.neocities.org")).
get(url)
end