diff --git a/sentry-resque/lib/sentry/resque.rb b/sentry-resque/lib/sentry/resque.rb index 7d0fd54a3..767772d76 100644 --- a/sentry-resque/lib/sentry/resque.rb +++ b/sentry-resque/lib/sentry/resque.rb @@ -34,13 +34,11 @@ def record(queue, worker, payload, &block) rescue Exception => exception klass = payload['class'].constantize - if Sentry.configuration.resque.report_after_job_retries && defined?(::Resque::Plugins::Retry) == 'constant' && klass.is_a?(::Resque::Plugins::Retry) - retry_key = klass.redis_retry_key(payload['args']) - retry_attempt = ::Resque.redis.get(retry_key) + raise if Sentry.configuration.resque.report_after_job_retries && + defined?(::Resque::Plugins::Retry) == 'constant' && + klass.is_a?(::Resque::Plugins::Retry) && + !klass.retry_limit_reached? - # If retry_attempt is nil, it means the resque-retry has already called the #clean_retry_key no retries are left - raise unless retry_attempt.nil? - end ::Sentry::Resque.capture_exception(exception, hint: { background: false }) finish_transaction(transaction, 500) raise