FEATURE: multisite support for posts:rebake_uncooked_posts

This commit is contained in:
Sam Saffron 2019-05-22 10:04:54 +10:00
parent a2428bd862
commit d6daa60d0a
1 changed files with 11 additions and 8 deletions

View File

@ -8,6 +8,8 @@ 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
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)
rebaked = 0 rebaked = 0
@ -20,6 +22,7 @@ task 'posts:rebake_uncooked_posts' => :environment do
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'
task 'posts:refresh_oneboxes' => :environment do task 'posts:refresh_oneboxes' => :environment do