mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:59:50 +08:00
FEATURE: multisite support for posts:rebake_uncooked_posts
This commit is contained in:
parent
a2428bd862
commit
d6daa60d0a
|
@ -8,17 +8,20 @@ task 'posts:rebake' => :environment do
|
|||
end
|
||||
|
||||
task 'posts:rebake_uncooked_posts' => :environment do
|
||||
uncooked = Post.where('baked_version <> ? or baked_version IS NULL', Post::BAKED_VERSION)
|
||||
RailsMultisite::ConnectionManagement.each_connection do
|
||||
puts "Rebaking uncooked posts on #{RailsMultisite::ConnectionManagement.current_db}"
|
||||
uncooked = Post.where('baked_version <> ? or baked_version IS NULL', Post::BAKED_VERSION)
|
||||
|
||||
rebaked = 0
|
||||
total = uncooked.count
|
||||
rebaked = 0
|
||||
total = uncooked.count
|
||||
|
||||
uncooked.find_each do |post|
|
||||
rebake_post(post)
|
||||
print_status(rebaked += 1, total)
|
||||
uncooked.find_each do |post|
|
||||
rebake_post(post)
|
||||
print_status(rebaked += 1, total)
|
||||
end
|
||||
|
||||
puts "", "#{rebaked} posts done!", ""
|
||||
end
|
||||
|
||||
puts "", "#{rebaked} posts done!", ""
|
||||
end
|
||||
|
||||
desc 'Update each post with latest markdown and refresh oneboxes'
|
||||
|
|
Loading…
Reference in New Issue
Block a user