EOFError: end of file reached issue with Net::HTTP

后端 未结 7 910
[愿得一人]
[愿得一人] 2020-11-30 21:54

I am using ruby-1.8.7-p302/Rails 2.3.11. I am trying to use FQL (Facebook API) to get stats for a link. Here\'s my code:

def stats(fb_post_url)
  url = BASE_         


        
相关标签:
7条回答
  • 2020-11-30 22:23

    After doing some research, this was happening in Ruby's XMLRPC::Client library - which uses NET::HTTP. The client uses the start() method in NET::HTTP which keeps the connection open for future requests.

    This happened precisely at 30 seconds after the last requests - so my assumption here is that the server it's hitting is closing requests after that time. I'm not sure what the default is for NET::HTTP to keep the request open - but I'm about to test with 60 seconds to see if that solves the issue.

    0 讨论(0)
提交回复
热议问题