Commit 2c334744 authored by Yorick Peterse's avatar Yorick Peterse

Disable scheduling of productivity analytics

This migration times out on both GitLab's staging and production
environments, even when an index is added for the columns used. As we
are nearing release day we have decided to turn this migration into a
noop for the time being.

The background migration is not removed as some jobs may have been
scheduled (especially in dev environments). Keeping this code allows
those jobs to finish, and allows us to reschedule it in the future if
needed.
parent ed4d4353
......@@ -5,24 +5,8 @@ class ScheduleProductivityAnalyticsBackfill < ActiveRecord::Migration[5.2]
DOWNTIME = false
BATCH_SIZE = 10_000
INTERVAL = 3.minutes
MIGRATION = 'Gitlab::BackgroundMigration::RecalculateProductivityAnalytics'.freeze
disable_ddl_transaction!
def up
return unless Gitlab.ee?
metrics_model = Class.new(ActiveRecord::Base) do
self.table_name = 'merge_request_metrics'
include ::EachBatch
end
scope = metrics_model.where("merged_at >= ?", 3.months.ago)
queue_background_migration_jobs_by_range_at_intervals(scope, MIGRATION, INTERVAL, batch_size: BATCH_SIZE)
# no-op since the scheduling times out on GitLab.com
end
def down
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment