我在一个 Sinatra 应用程序中构建了一个相当简单的Tweetstream监听器,我试图在 Heroku 上运行它。它启动并运行良好,但大约一分钟后我收到以下错误:
2012-12-04T06:23:31+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-12-04T06:23:31+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
基本上,这是我正在运行的内容:
require 'sinatra'
client = TwitterListener.new
puts "starting Twitter listener..."
client.restart
require 'tweetstream'
class TwitterListener
def initialize
@client = TweetStream::Client.new
...
@events = Events.new
end
def restart
...
@client.follow(users) do |status|
@events.mention_artist?(status, artists)
@events.retweet_artist?(status, artists)
end
end
end
它正在启动流式侦听器,如果我发推文的速度足够快,它就会接收到它,但 Heroku 似乎在推文流循环期间超时。我怎样才能解决这个问题?