Commit 8354810f authored by Adam Niedzielski's avatar Adam Niedzielski

Use Members::AuthorizedDestroyService in RemoveExpiredMembersWorker.

parent b4b51441
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment