From a9af77d65013d9c527b5173756eeba95f006e872 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Wed, 22 May 2019 10:31:49 +1000 Subject: [PATCH] PERF: ensure priority for rake rebake tasks is ultra low Flooding the default queue with lots of jobs is never a good thing. This reduces the risk of sidekiq going into a bad state post rebake --- lib/tasks/posts.rake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tasks/posts.rake b/lib/tasks/posts.rake index f20f961ce16..776aa5fb85f 100644 --- a/lib/tasks/posts.rake +++ b/lib/tasks/posts.rake @@ -111,6 +111,9 @@ def rebake_posts(opts = {}) end def rebake_post(post, opts = {}) + if !opts[:priority] + opts[:priority] = :ultra_low + end post.rebake!(opts) rescue => e puts "", "Failed to rebake (topic_id: #{post.topic_id}, post_id: #{post.id})", e, e.backtrace.join("\n")