Skip to content

Instantly share code, notes, and snippets.

@zetter
Created March 22, 2018 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zetter/7962f5364bbdeaddcf19600e2fdb0b5f to your computer and use it in GitHub Desktop.
Save zetter/7962f5364bbdeaddcf19600e2fdb0b5f to your computer and use it in GitHub Desktop.
Re-writing method without timeout
def wait_for_pending_requests
start = Time.now
while pending_requests?
if (Time.now - start) > 60
raise "Requests did not finish in 60 seconds"
else
sleep(0.01)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment