mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Disable delete cache worker for the moment, we don't use it
This commit is contained in:
parent
7198e788d1
commit
154abfc167
1 changed files with 5 additions and 3 deletions
|
@ -6,7 +6,7 @@ require 'open-uri'
|
||||||
# It's some nginx bug. I'm not going to deal with it.
|
# It's some nginx bug. I'm not going to deal with it.
|
||||||
|
|
||||||
class DeleteCacheWorker
|
class DeleteCacheWorker
|
||||||
HTTP_TIMEOUT = 5
|
HTTP_TIMEOUT = 10
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
sidekiq_options queue: :deletecache, retry: 3, backtrace: false, average_scheduled_poll_interval: 1
|
sidekiq_options queue: :deletecache, retry: 3, backtrace: false, average_scheduled_poll_interval: 1
|
||||||
|
|
||||||
|
@ -16,15 +16,17 @@ class DeleteCacheWorker
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform(proxy_ip, username, path)
|
def perform(proxy_ip, username, path)
|
||||||
|
# DOES NOTHING RIGHT NOW SO WE JUST RETURN
|
||||||
|
return
|
||||||
# Must always have a forward slash
|
# Must always have a forward slash
|
||||||
path = '/' + path if path[0] != '/'
|
path = '/' + path if path[0] != '/'
|
||||||
|
|
||||||
url = Addressable::URI.encode_component(
|
url = Addressable::URI.encode_component(
|
||||||
"https://#{proxy_ip}/:cache/purge#{path}",
|
"http://#{proxy_ip}/:cache/purge#{path}",
|
||||||
Addressable::URI::CharacterClasses::QUERY
|
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")).
|
headers(host: URI::encode("#{username}.neocities.org")).
|
||||||
get(url)
|
get(url)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue