Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Error Message
- mailing_worker started
- Schedules for worker loaded
- do_work
- mailing_worker -- working
- development environment finding custom people
- ---- have 1 mailings to process
- ---- processing mailing 226
- ---- delivering to kineticac@gmail.com (kineticac@gmail.com) : 27264
- ---- unable to send to kineticac@gmail.com : 27264
- Exception: NoMethodError: You have a nil object when you didn't expect it!
- You might have expected an instance of Array.
- The error occurred while evaluating nil.[]
- You have a nil object when you didn't expect it!
- You might have expected an instance of Array.
- The error occurred while evaluating nil.[]
- ---- mailing 226 complete, sent 0
- ## rescue block code
- if mailing.status != Mailing::STATUS_IN_PROGRESS && mailing.status != Mailing::STATUS_COMPLETED
- @logger.info("---- processing mailing "+mailing.id.to_s)
- mailing.status = Mailing::STATUS_IN_PROGRESS
- mailing.save
- @num_sent = 0
- for person in persons
- begin
- link_text = "mailkey=" + rand(99999999999).to_s + "-" + mailing.id.to_s + "-" + person.id.to_s + "-" + rand(99999999).to_s
- if ENV["RAILS_ENV"]=="production"
- rcpt = person.email
- else
- rcpt = "kineticac@gmail.com"
- end
- @logger.info("---- delivering to "+person.email+" ("+rcpt+") : "+person.id.to_s)
- email = NewsletterMailer.create_daily(rcpt, mailing, NewsletterMailer::TYPE_SUBSCRIPTION, args[:server_name], link_text, {})
- email.set_content_type("text/html")
- NewsletterMailer.deliver(email)
- @num_sent += 1
- if @num_sent % 10 == 0
- mailing.num_sent = @num_sent
- mailing.save
- end
- rescue Exception => e
- @logger.info("---- unable to send to " + person.email + " : " + person.id.to_s)
- @logger.error("Exception: #{e.class}: #{e.message}\n\t")
- @logger.error($!)
- end
Add Comment
Please, Sign In to add comment