我正在尝试执行 ruby 守护进程无框架Heroku 上的应用程序,但在尝试执行工作程序后崩溃:
heroku[worker.1]: State changed from crashed to starting
heroku[worker.1]: Starting process with command `bundle exec rake twitter:start`
heroku[worker.1]: State changed from starting to up
heroku[worker.1]: Process exited with status 0
heroku[worker.1]: State changed from up to crashed
该应用程序基本上通过一系列 API 收集数据,并将其保存在远程 MongoHQ 实例上。
耙子任务是:
dir_path = File.expand_path('../', __FILE__)
namespace :twitter do
desc 'Start Twitter daemon'
task :start do
exec "#{dir_path}/bin/autana start"
end
...
end
Procfile 非常简单:worker: bundle exec rake twitter:start
执行守护进程的代码如下:
#!/usr/bin/env ruby
require 'daemons'
require File.expand_path('../../lib/autana', __FILE__)
Daemons.run_proc('autana', multiple: true, no_pidfiles: true) do
client = Autana::Client::Twitter.new
client.collect
end
有任何想法吗?
可以动态运行吗?
heroku run rake twitter:start
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)