gitlab-org--gitlab-foss/app/uploaders
Sean McGivern 6ecf819f73 Fix an N+1 in avatar URLs
This is tricky: the query was being run in
`ObjectStorage::Extension::RecordsUploads#retrieve_from_store!`, but we can't
just add batch loading there, because the `#upload=` method there would use the
result immediately, making the batch only have one item.

Instead, we can pre-emptively add an item to the batch whenever an avatarable
object is initialized, and then reuse that batch item in
`#retrieve_from_store!`. However, this also has problems:

1. There is a lot of logic in `Avatarable#retrieve_upload_from_batch`.
2. Some of that logic constructs a 'fake' model for the batch key. This should
   be fine, because of ActiveRecord's override of `#==`, but it relies on that
   staying the same.
2018-06-05 14:57:19 +01:00
..
attachment_uploader.rb fixing some broken merges 2018-03-02 16:19:17 -05:00
avatar_uploader.rb Merge branch '4163-move-uploads-to-object-storage' into 'master' 2018-02-28 20:58:15 +01:00
file_mover.rb personal snippets will now comply with background_upload 2018-03-26 08:33:53 -04:00
file_uploader.rb Merge branch 'poc-upload-hashing-path' into 'master' 2018-03-08 09:25:56 -05:00
gitlab_uploader.rb Resolve "Avatar URLs are wrong when using a CDN path and Object Storage" 2018-04-23 16:59:53 +00:00
job_artifact_uploader.rb Update ProjectStatistics#build_artifacts_size synchronously without summing (#41059) 2018-04-19 18:35:40 +10:00
legacy_artifact_uploader.rb Add direct_upload setting for artifacts 2018-04-05 15:01:14 +02:00
lfs_object_uploader.rb Backport ee-40781-os-to-ce 2018-03-22 08:49:04 -04:00
namespace_file_uploader.rb Merge branch 'poc-upload-hashing-path' into 'master' 2018-03-08 09:25:56 -05:00
object_storage.rb Fix an N+1 in avatar URLs 2018-06-05 14:57:19 +01:00
personal_file_uploader.rb Merge branch 'poc-upload-hashing-path' into 'master' 2018-03-08 09:25:56 -05:00
records_uploads.rb Merge branch 'fix/sm/atomic-migration' into 'master' 2018-02-28 21:28:26 +01:00
uploader_helper.rb Merge branch '4163-move-uploads-to-object-storage' into 'master' 2018-02-28 20:58:15 +01:00
workhorse.rb Merge branch '4163-move-uploads-to-object-storage' into 'master' 2018-02-28 20:58:15 +01:00