Module: Sufia::Utils

Extended by:
ActiveSupport::Concern
Defined in:
lib/sufia/models/utils.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#retry_unless(number_of_tries, condition, &block) ⇒ Object

retry the block if the conditional call is true unless we hit the maximum tries

Parameters:

  • number_of_tries (enumerator)

    maximum number of times to retry the block (eg. 7.times)

  • condition (#call)

    conditional to call and see if we SHOULD retry

Returns:

  • result of the block call



13
14
15
# File 'lib/sufia/models/utils.rb', line 13

def retry_unless(number_of_tries, condition, &block)
  self.class.retry_unless(number_of_tries, condition, &block)
end