Welcome to mirror list, hosted at ThFree Co, Russian Federation.

prune_old_events_worker.rb « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d75083f9ab198c576d9e9bfd32b54808aa68bb02 (plain)
1
2
3
4
5
6
7
8
class PruneOldEventsWorker
  include Sidekiq::Worker

  def perform
    # Contribution calendar shows maximum 12 months of events
    Event.delete(Event.unscoped.where('created_at < ?', (12.months + 1.day).ago).limit(10_000).pluck(:id))
  end
end