我有一个 Heroku 计划作业,应该每 10 分钟运行一次。它只是向执行某些操作的控制器的操作发出 HTTP GET 请求。
desc "This task is called by the Heroku scheduler add-on"
task :send_notifications => :environment do
response = HTTParty.get('http://sendnotificationapp.com/sms/send_notifications')
end
当我做 rake 时,任务运行正常:
heroku rake send_notifications
虽然当我使用 Heroku 调度程序 GUI 将其设置为每 10 分钟运行一次时,它无法运行。相反,我收到以下错误:
Starting process with command `send_notifications` by scheduler@addons.heroku.com
Starting process with command `send_notifications`
bash: send_notifications: command not found
Process exited with status 127
有什么想法吗?
谢谢!