Class: Sidekiq::ElasticsearchOldIndexCleanerWorker

Inherits:
Object
  • Object
show all
Includes:
Worker
Defined in:
app/workers/sidekiq/elasticsearch_old_index_cleaner_worker.rb

Instance Method Summary collapse

Instance Method Details

#performObject



8
9
10
11
12
13
14
15
16
17
18
# File 'app/workers/sidekiq/elasticsearch_old_index_cleaner_worker.rb', line 8

def perform
  # Record the starting time of the process
  starting_time = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)

  # Iterate over each index class and attempt to clean old indices
  ::HasHelpers::Index.indices&.each do |index_class|
    clean_old_indices(index_class, starting_time)
  rescue StandardError => e
    handle_error(index_class.name, starting_time, e)
  end
end