use purge_all_cache instread of delete_all_cache

This commit is contained in:
Kyle Drake 2023-11-21 16:57:49 -06:00
parent 4c3daea4a8
commit 7b9107393b
3 changed files with 7 additions and 11 deletions

View file

@ -92,8 +92,8 @@ post '/settings/:username/change_name' do
} }
old_site.delete_all_thumbnails_and_screenshots old_site.delete_all_thumbnails_and_screenshots
old_site.delete_all_cache old_site.purge_all_cache
@site.delete_all_cache @site.purge_all_cache
@site.regenerate_thumbnails_and_screenshots @site.regenerate_thumbnails_and_screenshots
flash[:success] = "Site/user name has been changed. You will need to use this name to login, <b>don't forget it!</b>" flash[:success] = "Site/user name has been changed. You will need to use this name to login, <b>don't forget it!</b>"

View file

@ -504,7 +504,7 @@ class Site < Sequel::Model
def after_destroy def after_destroy
update_redis_proxy_record update_redis_proxy_record
delete_all_cache purge_all_cache
end end
def undelete! def undelete!
@ -518,7 +518,7 @@ class Site < Sequel::Model
} }
update_redis_proxy_record update_redis_proxy_record
delete_all_cache purge_all_cache
true true
end end
@ -768,16 +768,12 @@ class Site < Sequel::Model
end end
end end
def delete_all_cache def purge_all_cache
site_files.each do |site_file| site_files.each do |site_file|
delete_cache site_file.path purge_cache site_file.path
end end
end end
def delete_cache(path)
purge_cache path
end
#Rye::Cmd.add_command :ipfs #Rye::Cmd.add_command :ipfs
def add_to_ipfs def add_to_ipfs

View file

@ -105,7 +105,7 @@ class SiteFile < Sequel::Model
DB['update sites set space_used=space_used-? where id=?', size, site_id].first DB['update sites set space_used=space_used-? where id=?', size, site_id].first
end end
site.delete_cache site.files_path(path) site.purge_cache site.files_path(path)
SiteChangeFile.filter(site_id: site_id, filename: path).delete SiteChangeFile.filter(site_id: site_id, filename: path).delete
end end
end end