mirror of
https://github.com/neocities/neocities.git
synced 2025-08-04 08:42:00 +02:00
purge cache pubsub implementation
This commit is contained in:
parent
b786df44d1
commit
94b3fd6903
4 changed files with 39 additions and 0 deletions
7
app.rb
7
app.rb
|
@ -545,6 +545,9 @@ post '/change_name' do
|
|||
redirect '/settings'
|
||||
end
|
||||
|
||||
old_host = current_site.host
|
||||
old_file_paths = current_site.file_list.collect {|f| f.filename}
|
||||
|
||||
current_site.username = params[:name]
|
||||
|
||||
if current_site.valid?
|
||||
|
@ -553,6 +556,10 @@ post '/change_name' do
|
|||
current_site.move_files_from old_username
|
||||
}
|
||||
|
||||
old_file_paths.each do |file_path|
|
||||
PurgeCacheWorker.async_queue "#{old_host}/#{file_path}"
|
||||
end
|
||||
|
||||
flash[:success] = "Site/user name has been changed. You will need to use this name to login, <b>don't forget it</b>."
|
||||
redirect '/settings'
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue