gitlab-org--gitlab-foss/app/workers/migrate_external_diffs_worker.rb
Nick Thomas 0e831b0b69
Allow external diffs to be used conditionally
Since external diffs are likely to be a bit slower than in-database
ones, add a mode that makes diffs external after they've been obsoleted
by events. This should strike a balance between performance and disk
space.

A background cron drives the majority of migrations, since diffs become
outdated through user actions.
2019-03-27 16:51:33 +00:00

12 lines
292 B
Ruby

# frozen_string_literal: false
class MigrateExternalDiffsWorker
include ApplicationWorker
def perform(merge_request_diff_id)
diff = MergeRequestDiff.find_by_id(merge_request_diff_id)
return unless diff
MergeRequests::MigrateExternalDiffsService.new(diff).execute
end
end