jobs: drop favgroup expunge job.
Make `Post#expunge!` remove favgroups synchronously.
This commit is contained in:
@@ -178,13 +178,6 @@ class FavoriteGroup < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def self.purge_post(post_id)
|
||||
post_id = post_id.id if post_id.is_a?(Post)
|
||||
for_post(post_id).find_each do |group|
|
||||
group.remove!(post_id)
|
||||
end
|
||||
end
|
||||
|
||||
def remove!(post_id)
|
||||
with_lock do
|
||||
post_id = post_id.id if post_id.is_a?(Post)
|
||||
|
||||
@@ -1000,7 +1000,9 @@ class Post < ApplicationRecord
|
||||
end
|
||||
|
||||
def remove_from_fav_groups
|
||||
FavoriteGroup.delay.purge_post(id)
|
||||
FavoriteGroup.for_post(id).find_each do |favgroup|
|
||||
favgroup.remove!(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user