Ruby on rails 考拉的脸谱

Ruby on rails 考拉的脸谱,ruby-on-rails,timeout,koala,timeoutexception,Ruby On Rails,Timeout,Koala,Timeoutexception,如何在Rails中使用koala gem for Facebook引发超时错误 如果有人知道,请告诉我。您可以使用ruby的超时模块,如下所示: require 'timeout' begin status = Timeout::timeout(5) do @koala_api.get_connection 'me', :feed end rescue Timeout::Error # do something on timeout end 最好的方法是: Koa

如何在Rails中使用koala gem for Facebook引发超时错误


如果有人知道,请告诉我。

您可以使用ruby的超时模块,如下所示:

require 'timeout'
begin
   status = Timeout::timeout(5) do
      @koala_api.get_connection 'me', :feed
   end
rescue Timeout::Error
   # do something on timeout
end

最好的方法是:
Koala.http_service.http_options={请求:{open_timeout:1,timeout:1}}

超时:不是线程安全的。并可能导致意想不到的后果。正如基德所说的多线程场景中的行为。@NandoSousa你只是在冒犯,因为你没有支持你的陈述,所以你的观点必须被扔进垃圾桶……看一看:不要被冒犯,要谦虚地承认你错了。@NandoSousa,报纸上只展示了关于这个主题的想象,没有任何证据,所以这是唯一的猜测和推测。。。所以你不能因为没有证据的猜测而否决投票