Class: ResqueRetry::RetryFailureBackend

Inherits:
Resque::Failure::Multiple
  • Object
show all
Includes:
Resque::Helpers
Defined in:
lib/resque-retry/retry_failure_backend.rb

Instance Method Summary collapse

Instance Method Details

#saveObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/resque-retry/retry_failure_backend.rb', line 8

def save
  unless retrying?
    super
  else
    data = {
            :failed_at => Time.now.strftime("%Y/%m/%d %H:%M:%S"),
            :payload   => payload,
            :exception => exception.class.to_s,
            :error     => exception.to_s,
            :backtrace => Array(exception.backtrace),
            :worker    => worker.to_s,
            :queue     => queue
    }
    data = Resque.encode(data)
    Resque.redis[failure_key]=data
  end
end