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

29 lines
757 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
module Packages
module Nuget
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
2020-07-28 23:09:34 +05:30
queue_namespace :package_repositories
feature_category :package_registry
def perform(package_file_id)
package_file = ::Packages::PackageFile.find_by_id(package_file_id)
return unless package_file
::Packages::Nuget::UpdatePackageFromMetadataService.new(package_file).execute
2021-06-08 01:23:25 +05:30
rescue StandardError => e
2020-07-28 23:09:34 +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)
2020-07-28 23:09:34 +05:30
end
end
end
end