views:

23

answers:

1

I used Delayed_Jobs to send emails. Except I think that if it fails to send to 'every single email' then it tries and reruns the entire batch again.

How do I make it skip an email address if its not correct?

+1  A: 

Hi, if an exception occurs delayed_job will treat the job as failed and keep rerunning it. You should capture exceptions to make sure that at the end a job will always be considered as succesful.

nathanvda
Ah. I feel 10x better knowing that my assumption was true then. That's why it sent so many times. Is what your suggesting, a 'rescue' param?
Trip
Yes indeed, just `rescue StandardError => e` or something like that. In my project i am actually using this fact to make sure that certain tasks get tried different times in a row, so i raise an exception on purpose until some condition is met.
nathanvda