From a2220feaeafc72853aba21e94f08900058de08ff Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Mon, 15 Aug 2016 16:24:30 +0530 Subject: [PATCH] FEATURE: new site setting rebake_old_posts_count --- app/jobs/scheduled/periodical_updates.rb | 2 +- config/locales/server.en.yml | 2 ++ config/site_settings.yml | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/jobs/scheduled/periodical_updates.rb b/app/jobs/scheduled/periodical_updates.rb index 2d0485ba5..70c634e73 100644 --- a/app/jobs/scheduled/periodical_updates.rb +++ b/app/jobs/scheduled/periodical_updates.rb @@ -29,7 +29,7 @@ module Jobs # Forces rebake of old posts where needed, as long as no system avatars need updating unless UserAvatar.where("last_gravatar_download_attempt IS NULL").limit(1).first - problems = Post.rebake_old(250) + problems = Post.rebake_old(SiteSetting.rebake_old_posts_count) problems.each do |hash| post_id = hash[:post].id Discourse.handle_job_exception(hash[:ex], error_context(args, "Rebaking post id #{post_id}", post_id: post_id)) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 2bb0fd464..41b3d6930 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1029,6 +1029,8 @@ en: top_topics_formula_first_post_likes_multiplier: "value of first post likes multiplier (n) in top topics formula: `log(views_count) * 2 + op_likes_count * (n) + LEAST(likes_count / posts_count, 3) + 10 + log(posts_count)`" top_topics_formula_least_likes_per_post_multiplier: "value of least likes per post multiplier (n) in top topics formula: `log(views_count) * 2 + op_likes_count * 0.5 + LEAST(likes_count / posts_count, (n)) + 10 + log(posts_count)`" + rebake_old_posts_count: "Number of old posts to be rebaked every 15 minutes." + rate_limit_create_topic: "After creating a topic, users must wait (n) seconds before creating another topic." rate_limit_create_post: "After posting, users must wait (n) seconds before creating another post." rate_limit_new_user_create_topic: "After creating a topic, new users must wait (n) seconds before creating another topic." diff --git a/config/site_settings.yml b/config/site_settings.yml index 9b9ae8e3c..f1f7707c5 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -942,6 +942,9 @@ developer: top_topics_formula_least_likes_per_post_multiplier: default: 3 min: 0 + rebake_old_posts_count: + default: 250 + min: 1 migrate_to_new_scheme: hidden: true default: false