diff --git a/app/workers/remove_expired_members_worker.rb b/app/workers/remove_expired_members_worker.rb index 30486b9e8a3..027abf50587 100644 --- a/app/workers/remove_expired_members_worker.rb +++ b/app/workers/remove_expired_members_worker.rb @@ -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