dou*_*ets 5 http-get heroku scheduled-tasks
我有一个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
Run Code Online (Sandbox Code Playgroud)
当我做一个耙子时,任务运行并正常运行:
heroku rake send_notifications
Run Code Online (Sandbox Code Playgroud)
虽然当我使用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
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
谢谢!
wil*_*ynn 12
听起来像你设置Heroku调度程序工作send_notifications,而不是rake send_notifications或bundle exec rake send_notifications.
| 归档时间: |
|
| 查看次数: |
592 次 |
| 最近记录: |