summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-01 00:09:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-01 00:09:48 +0000
commit0dc67904c1b8b01e7406fc510cf432c5bfc919fb (patch)
tree93fffcf04b7d5ef50291c9d6386e6dd5f199dcef /app/services
parent915ce2e09259d71275f3e0a6e5214b793c2eb52e (diff)
downloadgitlab-ce-0dc67904c1b8b01e7406fc510cf432c5bfc919fb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r--app/services/packages/debian/process_changes_service.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/app/services/packages/debian/process_changes_service.rb b/app/services/packages/debian/process_changes_service.rb
index b6e81012656..a29cbd3f65f 100644
--- a/app/services/packages/debian/process_changes_service.rb
+++ b/app/services/packages/debian/process_changes_service.rb
@@ -42,22 +42,30 @@ module Packages
def update_files_metadata
files.each do |filename, entry|
- entry.package_file.package = package
-
file_metadata = ::Packages::Debian::ExtractMetadataService.new(entry.package_file).execute
+ ::Packages::UpdatePackageFileService.new(entry.package_file, package_id: package.id)
+ .execute
+
+ # Force reload from database, as package has changed
+ entry.package_file.reload_package
+
entry.package_file.debian_file_metadatum.update!(
file_type: file_metadata[:file_type],
component: files[filename].component,
architecture: file_metadata[:architecture],
fields: file_metadata[:fields]
)
- entry.package_file.save!
end
end
def update_changes_metadata
- package_file.update!(package: package)
+ ::Packages::UpdatePackageFileService.new(package_file, package_id: package.id)
+ .execute
+
+ # Force reload from database, as package has changed
+ package_file.reload_package
+
package_file.debian_file_metadatum.update!(
file_type: metadata[:file_type],
fields: metadata[:fields]