Mayank (www.apnabill.com)
2009-Jun-05 20:43 UTC
Slow/unpredictive response of post_form from rails lib
Hi friends, I''m facing a very strange problem... I consume a webservice from within my rails app. I''ve written a thin wrapper around the webservice using Net::HTTP.post_form However, when calling the API from within my controllers, the API calls randomly fail, complaining about timeout. But - when I wrote a simple iterative test (500 iterations), calling the same webservice using same thin wrapper (via rake) - to my surprise, none of the calls failed. I repeated the iterative test twice before thinking of writing to Rails forum... Any suggestions on what I might be doing wrong? Thanks in advance... Regards, Maku -- Posted via http://www.ruby-forum.com/.
MaurĂcio Linhares
2009-Jun-05 20:46 UTC
Re: Slow/unpredictive response of post_form from rails lib
A timeout from time to time isn''t something to worry about, in your library you can just add a "retry" clause and retry a specific number of times (maybe 2) before raising the exception to the calling code. - MaurĂcio Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Fri, Jun 5, 2009 at 5:43 PM, Mayank (www.apnabill.com)<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi friends, > > I''m facing a very strange problem... > > I consume a webservice from within my rails app. I''ve written a thin > wrapper around the webservice using Net::HTTP.post_form > > However, when calling the API from within my controllers, the API calls > randomly fail, complaining about timeout. > > But - when I wrote a simple iterative test (500 iterations), calling the > same webservice using same thin wrapper (via rake) - to my surprise, > none of the calls failed. > > I repeated the iterative test twice before thinking of writing to Rails > forum... > > Any suggestions on what I might be doing wrong? > > Thanks in advance... > > Regards, > Maku > -- > Posted via http://www.ruby-forum.com/. > > > >
Possibly Parallel Threads
- Sending post request with post_form
- A newbie question regarding BackgroundRb
- Unable to scrap gmail.com - EOFError: End of file reached
- alias_method_chain and Class methods (a Ruby question)
- Net::HTTP.post_form got 200 but no INSERT INTO. How come? How to fix this?