Class: Packages::Npm::ProcessTemporaryPackageFileWorker
- Inherits:
-
Object
- Object
- Packages::Npm::ProcessTemporaryPackageFileWorker
- Includes:
- ApplicationWorker, ErrorHandling
- Defined in:
- app/workers/packages/npm/process_temporary_package_file_worker.rb
Constant Summary collapse
- GLOBAL_ID_LOCATE_OPTIONS =
{ only: [::User, ::DeployToken] }.freeze
Constants included from ErrorHandling
ErrorHandling::CONTROLLED_ERRORS, ErrorHandling::DEFAULT_STATUS_MESSAGE
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_CONCURRENCY_LIMIT_PERCENTAGE_BY_URGENCY, WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DATA_CONSISTENCY_PER_DB, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::LOAD_BALANCED_DATA_CONSISTENCIES, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Instance Method Summary collapse
Methods included from ErrorHandling
#process_package_error_service_response, #process_package_file_error
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#perform(user_gid, package_file_id, deprecate) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/workers/packages/npm/process_temporary_package_file_worker.rb', line 17 def perform(user_gid, package_file_id, deprecate) user = safe_locate(user_gid) return unless user package_file = ::Packages::PackageFile.processing.find_by_id(package_file_id) return unless package_file params = { deprecate: } response = ::Packages::Npm::ProcessTemporaryPackageFileService.new(package_file:, user:, params:).execute process_package_error_service_response(package_file: package_file, message: response.) if response.error? rescue StandardError => exception raise exception unless package_file process_package_file_error(package_file: package_file, exception: exception) end |