diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /app/workers/packages | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'app/workers/packages')
-rw-r--r-- | app/workers/packages/helm/extraction_worker.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/workers/packages/helm/extraction_worker.rb b/app/workers/packages/helm/extraction_worker.rb new file mode 100644 index 00000000000..fd4e720da94 --- /dev/null +++ b/app/workers/packages/helm/extraction_worker.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Packages + module Helm + class ExtractionWorker + include ApplicationWorker + + queue_namespace :package_repositories + feature_category :package_registry + deduplicate :until_executing + + idempotent! + + def perform(channel, package_file_id) + package_file = ::Packages::PackageFile.find_by_id(package_file_id) + + return unless package_file && !package_file.package.default? + + ::Packages::Helm::ProcessFileService.new(channel, package_file).execute + + rescue ::Packages::Helm::ExtractFileMetadataService::ExtractionError, + ::Packages::Helm::ProcessFileService::ExtractionError, + ::ActiveModel::ValidationError => e + Gitlab::ErrorTracking.log_exception(e, project_id: package_file.project_id) + package_file.package.update_column(:status, :error) + end + end + end +end |