2016-08-04 03:41:29 -04:00
|
|
|
class RemoveExpiredMembersWorker
|
|
|
|
include Sidekiq::Worker
|
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
|
2016-08-04 17:35:28 -04:00
|
|
|
Members::AuthorizedDestroyService.new(member).execute
|
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
|