Rails_using Rufus in order to schedule sending mails daily

一曲冷凌霜 提交于 2019-12-12 02:15:57

问题


I want to schedule sending mails using Rufus-scheduler in a Rails app deployed on Heroku.

My code looks like

# config/initializers/scheduler.rb
require 'rufus-scheduler'
s = Rufus::Scheduler.singleton
s.every '11h30m' do
# here I put my sending mail task (already tested, and works well)
end

But nothing happened, and I can't figure out the issue based on my logs

I suspected some points:

1- Is my procfile correct ? Do I need something else in order to use Passenger ? will the classic webrick server work ?

web: bundle exec passenger start -p $PORT --max-pool-size 3 --min-instances 

2- I do not have a paid worker on Heroku, can I make Rufus-scheduler works with only one free standard web Dyno ?

3- If OK for the 2 questions, do I need to add something else to make the code works ?

Many thanks

来源:https://stackoverflow.com/questions/35651552/rails-using-rufus-in-order-to-schedule-sending-mails-daily

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