Heroku: delayed job sending email multiple times

三世轮回 提交于 2019-12-11 08:45:23

问题


We have one application(Rails 3) deployed in Heroku. For sending email digest to nearly about 500 users, we are using delayed_job.

Notifier.delay.send_email_digest(digest_content, @user)

My application has 3 web dynos and 2 worker dynos. Though the task is sending only one Email digest per user in local, In heroku (production) it's sending two email digests for some users (strange).

Is it due to two worker dynos (but why?? or mere coincidence). Can anybody help me solve the problem?

Thanks.


回答1:


Within your send_email_digest method are you calling deliver? Delayed Job uses some magic when sending emails and it will automatically call deliver for you. If you call deliver yourself it will send multiple times. I've had this happen on occasion.



来源:https://stackoverflow.com/questions/9496501/heroku-delayed-job-sending-email-multiple-times

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!