gitlab-org--gitlab-foss/app/workers/remove_expired_members_worker.rb
Rémy Coutable 1c88d92b3f Improve Member services
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-02-27 16:02:22 +01:00

14 lines
358 B
Ruby

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