mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Allow rebaking oncooked posts of single site
This commit is contained in:
parent
4fe885dedf
commit
fb121815a5
@ -8,7 +8,16 @@ task 'posts:rebake' => :environment do
|
|||||||
end
|
end
|
||||||
|
|
||||||
task 'posts:rebake_uncooked_posts' => :environment do
|
task 'posts:rebake_uncooked_posts' => :environment do
|
||||||
RailsMultisite::ConnectionManagement.each_connection do
|
ENV['RAILS_DB'] ? rebake_uncooked_posts : rebake_uncooked_posts_all_sites
|
||||||
|
end
|
||||||
|
|
||||||
|
def rebake_uncooked_posts_all_sites
|
||||||
|
RailsMultisite::ConnectionManagement.each_connection do |db|
|
||||||
|
rebake_uncooked_posts
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def rebake_uncooked_posts
|
||||||
puts "Rebaking uncooked posts on #{RailsMultisite::ConnectionManagement.current_db}"
|
puts "Rebaking uncooked posts on #{RailsMultisite::ConnectionManagement.current_db}"
|
||||||
uncooked = Post.where('baked_version <> ? or baked_version IS NULL', Post::BAKED_VERSION)
|
uncooked = Post.where('baked_version <> ? or baked_version IS NULL', Post::BAKED_VERSION)
|
||||||
|
|
||||||
@ -21,7 +30,6 @@ task 'posts:rebake_uncooked_posts' => :environment do
|
|||||||
end
|
end
|
||||||
|
|
||||||
puts "", "#{rebaked} posts done!", ""
|
puts "", "#{rebaked} posts done!", ""
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Update each post with latest markdown and refresh oneboxes'
|
desc 'Update each post with latest markdown and refresh oneboxes'
|
||||||
|
Loading…
Reference in New Issue
Block a user