debian-mirror-gitlab/app/workers/packages/rubygems/extraction_worker.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
783 B
Ruby
Raw Normal View History

2021-04-29 21:17:54 +05:30
# frozen_string_literal: true
module Packages
module Rubygems
class ExtractionWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
2021-10-27 15:23:28 +05:30
data_consistency :always
2021-06-08 01:23:25 +05:30
sidekiq_options retry: 3
2021-04-29 21:17:54 +05:30
queue_namespace :package_repositories
feature_category :package_registry
deduplicate :until_executing
def perform(package_file_id)
package_file = ::Packages::PackageFile.find_by_id(package_file_id)
return unless package_file
::Packages::Rubygems::ProcessGemService.new(package_file).execute
2021-06-08 01:23:25 +05:30
rescue StandardError => e
2021-04-29 21:17:54 +05:30
Gitlab::ErrorTracking.log_exception(e, project_id: package_file.project_id)
2021-06-08 01:23:25 +05:30
package_file.package.update_column(:status, :error)
2021-04-29 21:17:54 +05:30
end
end
end
end