Guest User

Untitled

a guest
May 17th, 2018
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. ## Error Message
  2.  
  3. mailing_worker started
  4. Schedules for worker loaded
  5. do_work
  6. mailing_worker -- working
  7. development environment finding custom people
  8. ---- have 1 mailings to process
  9. ---- processing mailing 226
  10. ---- delivering to kineticac@gmail.com (kineticac@gmail.com) : 27264
  11. ---- unable to send to kineticac@gmail.com : 27264
  12. Exception: NoMethodError: You have a nil object when you didn't expect it!
  13. You might have expected an instance of Array.
  14. The error occurred while evaluating nil.[]
  15.  
  16. You have a nil object when you didn't expect it!
  17. You might have expected an instance of Array.
  18. The error occurred while evaluating nil.[]
  19. ---- mailing 226 complete, sent 0
  20.  
  21.  
  22. ## rescue block code
  23.  
  24. if mailing.status != Mailing::STATUS_IN_PROGRESS && mailing.status != Mailing::STATUS_COMPLETED
  25. @logger.info("---- processing mailing "+mailing.id.to_s)
  26. mailing.status = Mailing::STATUS_IN_PROGRESS
  27. mailing.save
  28.  
  29. @num_sent = 0
  30. for person in persons
  31. begin
  32. link_text = "mailkey=" + rand(99999999999).to_s + "-" + mailing.id.to_s + "-" + person.id.to_s + "-" + rand(99999999).to_s
  33.  
  34. if ENV["RAILS_ENV"]=="production"
  35. rcpt = person.email
  36. else
  37. rcpt = "kineticac@gmail.com"
  38. end
  39.  
  40. @logger.info("---- delivering to "+person.email+" ("+rcpt+") : "+person.id.to_s)
  41.  
  42. email = NewsletterMailer.create_daily(rcpt, mailing, NewsletterMailer::TYPE_SUBSCRIPTION, args[:server_name], link_text, {})
  43. email.set_content_type("text/html")
  44.  
  45. NewsletterMailer.deliver(email)
  46.  
  47. @num_sent += 1
  48. if @num_sent % 10 == 0
  49. mailing.num_sent = @num_sent
  50. mailing.save
  51. end
  52. rescue Exception => e
  53. @logger.info("---- unable to send to " + person.email + " : " + person.id.to_s)
  54. @logger.error("Exception: #{e.class}: #{e.message}\n\t")
  55. @logger.error($!)
  56. end
Add Comment
Please, Sign In to add comment