retry_criteria_check methods are not triggered if both @retry_exceptions and @fatal_exceptions are nil per lines:
https://github.com/lantins/resque-retry/blob/v1.5.0/lib/resque/plugins/retry.rb#L275
https://github.com/lantins/resque-retry/blob/v1.5.0/lib/resque/plugins/retry.rb#L199
This case seems like a common one (defining a criteria check method without whitelisting or blacklisting any exception classes), and the behavior is not at all intuitive: the only constraint I define is not called because I didn't define others. For now, setting @retry_exceptions = [] is a sufficient workaround to fail the nil check without introducing unintended consequences, but retry_exceptions should not be required like this.
Never calls retry_criteria_check, always re-retries (up to limit):
extend Resque::Plugins::Retry
@retry_limit = 3
@retry_delay = 60
retry_criteria_check do |exception, *args|
exception.is_a?(Mandrill::Error) && exception.message.include?('504 Gateway Time-out')
end
Works as expected, calling retry_criteria_check logic:
extend Resque::Plugins::Retry
@retry_limit = 3
@retry_delay = 60
@retry_exceptions = []
retry_criteria_check do |exception, *args|
exception.is_a?(Mandrill::Error) && exception.message.include?('504 Gateway Time-out')
end
retry_criteria_check methods are not triggered if both @retry_exceptions and @fatal_exceptions are nil per lines:
https://github.com/lantins/resque-retry/blob/v1.5.0/lib/resque/plugins/retry.rb#L275
https://github.com/lantins/resque-retry/blob/v1.5.0/lib/resque/plugins/retry.rb#L199
This case seems like a common one (defining a criteria check method without whitelisting or blacklisting any exception classes), and the behavior is not at all intuitive: the only constraint I define is not called because I didn't define others. For now, setting @retry_exceptions = [] is a sufficient workaround to fail the nil check without introducing unintended consequences, but retry_exceptions should not be required like this.
Never calls retry_criteria_check, always re-retries (up to limit):
Works as expected, calling retry_criteria_check logic: