jobs: drop favgroup expunge job.

Make `Post#expunge!` remove favgroups synchronously.
This commit is contained in:
evazion
2019-08-16 20:49:34 -05:00
parent 798d524e60
commit 817f5ecf9c
3 changed files with 10 additions and 8 deletions

View File

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

View File

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