2016-08-04 03:41:29 -04:00
|
|
|
class RemoveExpiredMembersWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2016-10-21 12:13:41 -04:00
|
|
|
include CronjobQueue
|
2016-08-04 03:41:29 -04:00
|
|
|
|
|
|
|
def perform
|
2016-08-09 12:39:13 -04:00
|
|
|
Member.expired.find_each do |member|
|
2016-08-04 03:41:29 -04:00
|
|
|
begin
|
2018-02-16 09:10:22 -05:00
|
|
|
Members::DestroyService.new.execute(member, skip_authorization: true)
|
2016-08-04 03:41:29 -04:00
|
|
|
rescue => ex
|
|
|
|
logger.error("Expired Member ID=#{member.id} cannot be removed - #{ex}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|