jobs: migrate pool category updates to ActiveJob.
This commit is contained in:
8
app/jobs/update_pool_pseudo_tags_job.rb
Normal file
8
app/jobs/update_pool_pseudo_tags_job.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class UpdatePoolPseudoTagsJob < ApplicationJob
|
||||
queue_as :default
|
||||
queue_with_priority 20
|
||||
|
||||
def perform(pool)
|
||||
pool.update_category_pseudo_tags_for_posts
|
||||
end
|
||||
end
|
||||
@@ -291,7 +291,7 @@ class Pool < ApplicationRecord
|
||||
|
||||
def update_category_pseudo_tags_for_posts_async
|
||||
if saved_change_to_category?
|
||||
delay(:queue => "default").update_category_pseudo_tags_for_posts
|
||||
UpdatePoolPseudoTagsJob.perform_later(self)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user