gitlab-org--gitlab-foss/app/workers/remove_expired_members_worker.rb

17 lines
415 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class RemoveExpiredMembersWorker
include ApplicationWorker
include CronjobQueue
feature_category :authentication_and_authorization
def perform
2016-08-09 12:39:13 -04:00
Member.expired.find_each do |member|
2019-03-13 09:42:43 -04:00
Members::DestroyService.new.execute(member, skip_authorization: true)
rescue => ex
logger.error("Expired Member ID=#{member.id} cannot be removed - #{ex}")
end
end
end