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
This commit is contained in:
Sam Saffron 2019-05-22 10:31:49 +10:00
parent d9413a61d2
commit a9af77d650

View File

@ -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")