我正在尝试在Heroku上执行一个无框架的Ruby守护进程应用程序,但在尝试执行worker后它会崩溃。
有什么想法吗?
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实例中。
rake任务包括:
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
有什么想法吗?