Class: DeleteOldTransactionsJob

Inherits:
Object
  • Object
show all
Includes:
SentryLogging, Sidekiq::Job
Defined in:
app/sidekiq/delete_old_transactions_job.rb

Instance Method Summary collapse

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata

Instance Method Details

#performObject

:nocov:



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/sidekiq/delete_old_transactions_job.rb', line 8

def perform
  AsyncTransaction::Base
    .stale
    .find_each do |tx|
      tx.destroy!
  rescue ActiveRecord::RecordNotDestroyed => e
    log_message_to_sentry(
      'DeleteOldTransactionsJob raised an exception',
      :info,
      model: self.class.to_s,
      transaction_id: tx.id,
      exception: e.message
    )
    end
end