A module that adds #retryable
to your classes, which retries blocks when an exception occurs.
Add this line to your application's Gemfile:
gem 'retryable_block'
And then execute:
$ bundle
Or install it yourself as:
$ gem install retryable_block
Include RetryableBlock
to your class and use retryable(n=3, sleep_time=nil, exceptions = [StandardError], &block)
n=3
means 3 retries
sleep_time
number of seconds for sleep between retries, if nil
retry will be call immediately.
exceptions
list of exceptions for retries, you can pass list of exceptions classes, as default value it will use rescue StandardError
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)