Class: RailsPulse::CleanupJob

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

Instance Method Summary collapse

Instance Method Details

#performHash?

Performs scheduled cleanup of old RailsPulse data

Returns:

  • (Hash, nil)

    Stats hash with cleanup results or nil if archiving disabled



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

def perform
  return unless RailsPulse.configuration.archiving_enabled

  log_start
  stats = CleanupService.perform
  log_completion(stats)
  stats
rescue StandardError => e
  log_error(e)
  raise
end