blob: 0e21e98d1827eb63fc10a6e2771e6a058f5f570d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# frozen_string_literal: true
module Packages
module Debian
class ProcessPackageFileWorker
include ApplicationWorker
include Gitlab::Utils::StrongMemoize
data_consistency :always
deduplicate :until_executed
idempotent!
queue_namespace :package_repositories
feature_category :package_registry
def perform(package_file_id, distribution_name, component_name)
@package_file_id = package_file_id
@distribution_name = distribution_name
@component_name = component_name
return unless package_file
# return if file has already been processed
return unless package_file.debian_file_metadatum&.unknown?
::Packages::Debian::ProcessPackageFileService.new(package_file, distribution_name, component_name).execute
rescue StandardError => e
Gitlab::ErrorTracking.log_exception(e, package_file_id: @package_file_id,
distribution_name: @distribution_name, component_name: @component_name)
package_file.update_column(:status, :error)
package_file.package.update_column(:status, :error)
end
private
def package_file
::Packages::PackageFile.find_by_id(@package_file_id)
end
strong_memoize_attr :package_file
end
end
end
|