FEATURE: full rebake of all old posts

This limits to 100 post per 15 minutes, so it will take a while.

This will pick up CommonMark and a large amount of onebox fixes.
This commit is contained in:
Sam 2017-12-15 10:28:07 +11:00
parent 092c976d7c
commit f18dda2adc
2 changed files with 5 additions and 2 deletions

View File

@ -20,7 +20,9 @@ class Post < ActiveRecord::Base
self.permitted_create_params = Set.new self.permitted_create_params = Set.new
# increase this number to force a system wide post rebake # increase this number to force a system wide post rebake
BAKED_VERSION = 1 # Version 1, was the initial version
# Version 2 15-12-2017, introduces CommonMark and a huge number of onebox fixes
BAKED_VERSION = 2
rate_limit rate_limit
rate_limit :limit_posts_per_day rate_limit :limit_posts_per_day
@ -472,6 +474,7 @@ class Post < ActiveRecord::Base
def self.rebake_old(limit) def self.rebake_old(limit)
problems = [] problems = []
Post.where('baked_version IS NULL OR baked_version < ?', BAKED_VERSION) Post.where('baked_version IS NULL OR baked_version < ?', BAKED_VERSION)
.order('id desc')
.limit(limit).each do |p| .limit(limit).each do |p|
begin begin
p.rebake! p.rebake!

View File

@ -1095,7 +1095,7 @@ developer:
top_topics_formula_least_likes_per_post_multiplier: top_topics_formula_least_likes_per_post_multiplier:
default: 3 default: 3
rebake_old_posts_count: rebake_old_posts_count:
default: 250 default: 100
min: 1 min: 1
migrate_to_new_scheme: migrate_to_new_scheme:
hidden: true hidden: true