开发者

Ruby: Increase time before timeout?

开发者 https://www.devze.com 2023-02-15 03:44 出处:网络
I\'m trying to do the following: remote_feed = open(url) But the remote feed t开发者_StackOverflowakes a while to return, and the call times out.I just need to increase the time until timeout occur

I'm trying to do the following:

remote_feed = open(url)

But the remote feed t开发者_StackOverflowakes a while to return, and the call times out. I just need to increase the time until timeout occurs, is there a simple way to do this in ruby?

Thanks!


require 'open-uri'

open('http://stackoverflow.com', 'r', :read_timeout=>0.01) do |http|
  http.read
end
0

精彩评论

暂无评论...
验证码 换一张
取 消