Use Members::AuthorizedDestroyService in RemoveExpiredMembersWorker.
This commit is contained in:
parent
b4b51441aa
commit
8354810f10
1 changed files with 2 additions and 2 deletions
|
@ -2,9 +2,9 @@ class RemoveExpiredMembersWorker
|
|||
include Sidekiq::Worker
|
||||
|
||||
def perform
|
||||
Member.includes(:created_by).where("expires_at <= ?", Time.current).find_each do |member|
|
||||
Member.where("expires_at <= ?", Time.current).find_each do |member|
|
||||
begin
|
||||
Members::DestroyService.new(member, member.created_by).execute
|
||||
Members::AuthorizedDestroyService.new(member).execute
|
||||
rescue => ex
|
||||
logger.error("Expired Member ID=#{member.id} cannot be removed - #{ex}")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue