Class: DecisionReview::DeleteSavedClaimRecordsJob
- Inherits:
-
Object
- Object
- DecisionReview::DeleteSavedClaimRecordsJob
- Includes:
- Sidekiq::Job
- Defined in:
- app/sidekiq/decision_review/delete_saved_claim_records_job.rb
Constant Summary collapse
- STATSD_KEY_PREFIX =
'worker.decision_review.delete_saved_claim_records'
Instance Method Summary collapse
- #enabled? ⇒ Boolean private
- #perform ⇒ Object
Instance Method Details
#enabled? ⇒ Boolean (private)
28 29 30 |
# File 'app/sidekiq/decision_review/delete_saved_claim_records_job.rb', line 28 def enabled? Flipper.enabled? :decision_review_delete_saved_claims_job_enabled end |
#perform ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/sidekiq/decision_review/delete_saved_claim_records_job.rb', line 14 def perform return unless enabled? deleted_records = ::SavedClaim.where(delete_date: ..DateTime.now).destroy_all StatsD.increment("#{STATSD_KEY_PREFIX}.count", deleted_records.size) nil rescue => e StatsD.increment("#{STATSD_KEY_PREFIX}.error") Rails.logger.error('DecisionReview::DeleteSavedClaimRecordsJob perform exception', e.) end |