2019-09-30 21:07:59 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Namespaces
|
2020-04-08 14:13:33 +05:30
|
|
|
class PruneAggregationSchedulesWorker # rubocop:disable Scalability/IdempotentWorker
|
2019-09-30 21:07:59 +05:30
|
|
|
include ApplicationWorker
|
2020-03-13 15:44:24 +05:30
|
|
|
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
|
2019-09-30 21:07:59 +05:30
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
feature_category :source_code_management
|
2019-12-26 22:10:19 +05:30
|
|
|
worker_resource_boundary :cpu
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
# 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
|