I am using httparty (0.13.1) gem. I am making a series of API calls using httparty. Some of my initial API calls succeeded, but subsequent calls are interrupted sequentially. I added a timeout of 180 seconds. I searched google but I cannot find a solution. Because of this, I have been afraid for a long time.
My code is:
response = HTTParty.get("http://pubapi.cryptsy.com/api.php?method=marketdatav2", timeout: 180)
Error:
A Net::ReadTimeout occurred in background at 2014-10-05 11:42:06 UTC :
I do not know if this timeout works? I feel that 180 seconds is more than enough to get an answer, because the default timeout is 60 seconds. If I want to handle a Net Net timeout error, is there a way to do this? I want to return zero if this error occurs. Or is there a better solution to avoid this error?
source
share