From ddcc7eddfbd5cb56e3e295d9d28bd801830b803e Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 19 Aug 2019 00:46:30 -0500 Subject: [PATCH] jobs: migrate fixing post counts to ActiveJob. --- app/jobs/fix_tag_post_count_job.rb | 8 ++++++++ app/logical/tag_correction.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 app/jobs/fix_tag_post_count_job.rb diff --git a/app/jobs/fix_tag_post_count_job.rb b/app/jobs/fix_tag_post_count_job.rb new file mode 100644 index 000000000..3f6ab4ad7 --- /dev/null +++ b/app/jobs/fix_tag_post_count_job.rb @@ -0,0 +1,8 @@ +class FixTagPostCountJob < ApplicationJob + queue_as :default + queue_with_priority 20 + + def perform(tag) + tag.fix_post_count + end +end diff --git a/app/logical/tag_correction.rb b/app/logical/tag_correction.rb index 78c15a84b..6b326a89e 100644 --- a/app/logical/tag_correction.rb +++ b/app/logical/tag_correction.rb @@ -19,7 +19,7 @@ class TagCorrection end def fix! - tag.delay(:queue => "default").fix_post_count + FixTagPostCountJob.perform_later(tag) tag.update_category_cache end end