gitlab-org--gitlab-foss/app/workers/remove_expired_members_worker.rb
2019-03-13 13:42:43 +00:00

14 lines
361 B
Ruby

# frozen_string_literal: true
class RemoveExpiredMembersWorker
include ApplicationWorker
include CronjobQueue
def perform
Member.expired.find_each do |member|
Members::DestroyService.new.execute(member, skip_authorization: true)
rescue => ex
logger.error("Expired Member ID=#{member.id} cannot be removed - #{ex}")
end
end
end