Class: InnerPerformance::CleanupJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/inner_performance/cleanup_job.rb

Instance Method Summary collapse

Instance Method Details

#performObject



5
6
7
8
9
10
11
12
13
14
# File 'app/jobs/inner_performance/cleanup_job.rb', line 5

def perform
  InnerPerformance::Trace
    .joins(:event)
    .where("inner_performance_events.created_at < ?", InnerPerformance.configuration.events_retention.ago)
    .delete_all

  InnerPerformance::Event
    .where("created_at < ?", InnerPerformance.configuration.events_retention.ago)
    .delete_all
end