mirror of
https://github.com/neocities/neocities.git
synced 2025-08-01 23:31:52 +02:00
fix and test purge cache
This commit is contained in:
parent
445ec92226
commit
3e4e85ceee
2 changed files with 12 additions and 2 deletions
|
@ -202,7 +202,7 @@ class Site < Sequel::Model
|
|||
|
||||
%w{index not_found}.each do |name|
|
||||
File.write files_path("#{name}.html"), render_template("#{name}.erb")
|
||||
purge_cache "#{name}.html"
|
||||
purge_cache "/#{name}.html"
|
||||
ScreenshotWorker.perform_async values[:username], "#{name}.html"
|
||||
end
|
||||
|
||||
|
@ -327,7 +327,8 @@ class Site < Sequel::Model
|
|||
end
|
||||
|
||||
def purge_cache(path)
|
||||
payload = {site: username, path: path}
|
||||
relative_path = path.gsub(base_files_path, '')
|
||||
payload = {site: username, path: relative_path}
|
||||
payload[:domain] = domain if !domain.empty?
|
||||
PurgeCacheWorker.perform_async payload
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue