use #use_open_file for Packages::Debian::ExtractDebMetadataService
What does this MR do and why?
This MR was extracted from !78385 (closed), on the way to fix #340307 (closed).
quoting @10io
for #340307 (closed):
Tests on staging showed that background jobs for the debian registry are not working as expected with object storage.
[...]
- I see several uses of
#use_file
. This is known to leave thepackage_file
in an improper state that can't be saved. Basically, ifpackage_file.file.use_file
is called, thenpackage_file.save!
orpackage_file.update!
can't be called (triggers a validation error).🔧 Solution: package file updates where the package id or file_name are modified must be handled in a custom way. This is the result of the work on a similar nuget bug. In short, use this. Also useuse_open_file
which is better thanuse_file
.
^ Fixed (#use_file
replaced by #use_open_file
).