mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
flush empty index sites script
This commit is contained in:
parent
ff953f4c09
commit
48845f3435
1 changed files with 17 additions and 0 deletions
17
Rakefile
17
Rakefile
|
@ -253,6 +253,23 @@ task :dedupe_follows => [:environment] do
|
|||
end
|
||||
end
|
||||
|
||||
desc 'flush_empty_index_sites'
|
||||
task :flush_empty_index_sites => [:environment] do
|
||||
sites = Site.select(:id).all
|
||||
|
||||
counter = 0
|
||||
|
||||
sites.each do |site|
|
||||
if site.empty_index?
|
||||
counter += 1
|
||||
site.site_changed = false
|
||||
site.save_changes validate: false
|
||||
end
|
||||
end
|
||||
|
||||
puts "#{counter} sites set to not changed."
|
||||
end
|
||||
|
||||
=begin
|
||||
desc 'Update screenshots'
|
||||
task :update_screenshots => [:environment] do
|
||||
|
|
Loading…
Add table
Reference in a new issue