timeout #23

Closed
mpestritto opened this Issue Apr 30, 2012 · 3 comments

3 participants

@mpestritto

With the bitly snafu today, is there anyway to put in short timeout ( 2-3 seconds max ) or make it configurable for this library?

Some of my pages do on-the-fly Bitly link conversions for creating tweets and Bitly was taking over 30 seconds to return a timeout error which tied up processes on heroku. To a user, it seemed as the app was down because all processes were tied up.

@philnash philnash was assigned May 1, 2012
@philnash
Owner

That sounds like a good idea. Do you have time to knock up a patch at all?

@burtlo

A temporary workaround that you could use is Ruby's timeout

require 'timeout'

Timeout.timeout(5) do
  sleep 10
  puts "I'm awake"
end

This will timeout raising the exception Timeout::Error: execution expired.

@pedrocarrico pedrocarrico added a commit to pedrocarrico/bitly that referenced this issue Oct 24, 2012
@pedrocarrico pedrocarrico Add timeout to bit.ly API calls
This commit fixes issue #23
1f32832
@pedrocarrico pedrocarrico added a commit to pedrocarrico/bitly that referenced this issue Oct 31, 2012
@pedrocarrico pedrocarrico Add timeout to bit.ly API calls
This commit fixes issue #23
b9b3def
@philnash
Owner

This has been merged to master and will be part of a new gem soon.

@philnash philnash closed this Apr 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment