2019-07-02 14:44:39 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Namespaces
|
2020-02-19 18:09:10 +00:00
|
|
|
class PruneAggregationSchedulesWorker # rubocop:disable Scalability/IdempotentWorker
|
2019-07-02 14:44:39 +00:00
|
|
|
include ApplicationWorker
|
2020-02-04 15:08:40 +00:00
|
|
|
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
|
2019-07-02 14:44:39 +00:00
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :source_code_management
|
2019-10-30 15:14:17 +00:00
|
|
|
worker_resource_boundary :cpu
|
2019-10-18 11:11:44 +00:00
|
|
|
|
2019-07-02 14:44:39 +00:00
|
|
|
# Worker to prune pending rows on Namespace::AggregationSchedule
|
|
|
|
# It's scheduled to run once a day at 1:05am.
|
|
|
|
def perform
|
|
|
|
aggregation_schedules.find_each do |aggregation_schedule|
|
|
|
|
aggregation_schedule.schedule_root_storage_statistics
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def aggregation_schedules
|
|
|
|
Namespace::AggregationSchedule.all
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|