Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Time intervals between attempts
- For fixed intervals, an `:interval` parameter can be passed indicating the time in seconds.
- The following example will sleep two seconds between attempts:
- retry_upto(5, :interval => 2)
- For customized intervals, the `:interval` parameter can be a lambda, which will be applied
- to the number of each attempt. For instance, the following code will sleep 3 seconds after
- the first attempt, 6 after the second, 9 after the third...
- retry_upto(5, :interval => lambda{ |attempt| attempt * 3 })
Add Comment
Please, Sign In to add comment