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

Use Members::AuthorizedDestroyService in RemoveExpiredMembersWorker.

parent b4b51441
...@@ -2,9 +2,9 @@ class RemoveExpiredMembersWorker ...@@ -2,9 +2,9 @@ class RemoveExpiredMembersWorker
include Sidekiq::Worker include Sidekiq::Worker
def perform 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 begin
Members::DestroyService.new(member, member.created_by).execute Members::AuthorizedDestroyService.new(member).execute
rescue => ex rescue => ex
logger.error("Expired Member ID=#{member.id} cannot be removed - #{ex}") logger.error("Expired Member ID=#{member.id} cannot be removed - #{ex}")
end 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