mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
Merge branch 'master' of github.com:neocities/neocities
This commit is contained in:
commit
4bab84cf9d
2 changed files with 9 additions and 1 deletions
|
@ -117,7 +117,7 @@ class Site < Sequel::Model
|
||||||
custom_ssl_certificates: false,
|
custom_ssl_certificates: false,
|
||||||
no_file_restrictions: false,
|
no_file_restrictions: false,
|
||||||
custom_domains: false,
|
custom_domains: false,
|
||||||
maximum_site_files: 1000
|
maximum_site_files: 2000
|
||||||
)
|
)
|
||||||
|
|
||||||
def self.newsletter_sites
|
def self.newsletter_sites
|
||||||
|
|
|
@ -18,11 +18,19 @@ class PurgeCacheWorker
|
||||||
"http://#{proxy_ip}#{path}",
|
"http://#{proxy_ip}#{path}",
|
||||||
Addressable::URI::CharacterClasses::QUERY
|
Addressable::URI::CharacterClasses::QUERY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
retry_encoded = false
|
||||||
|
|
||||||
begin
|
begin
|
||||||
RestClient::Request.execute method: :head, url: url, timeout: HTTP_TIMEOUT, headers: {
|
RestClient::Request.execute method: :head, url: url, timeout: HTTP_TIMEOUT, headers: {
|
||||||
host: URI::encode("#{username}.neocities.org"),
|
host: URI::encode("#{username}.neocities.org"),
|
||||||
cache_purge: '1'
|
cache_purge: '1'
|
||||||
}
|
}
|
||||||
|
rescue URI::InvalidURIError
|
||||||
|
raise if retry_encoded == true
|
||||||
|
url = URI.encode url
|
||||||
|
retry_encoded = true
|
||||||
|
retry
|
||||||
rescue RestClient::ResourceNotFound
|
rescue RestClient::ResourceNotFound
|
||||||
rescue RestClient::Forbidden
|
rescue RestClient::Forbidden
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue