mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Add hidden s3_inventory_bucket_region
site setting (#27786)
This commit adds a hidden `s3_inventory_bucket_region` site setting to specify the region of the `s3_inventory_bucket` when the `S3Inventory` class initializes an instance of the `S3Helper`. By default, the `S3Helper` class uses the value of the `s3_region` site setting but the region of the `s3_inventory_bucket` is not always the same as the `s3_region` configured.
This commit is contained in:

committed by
GitHub

parent
7111d5e4bf
commit
86e5f46175
@ -298,7 +298,13 @@ module FileStore
|
||||
|
||||
def list_missing_uploads(skip_optimized: false)
|
||||
if s3_inventory_bucket = SiteSetting.s3_inventory_bucket
|
||||
S3Inventory.new(:upload, s3_inventory_bucket:).backfill_etags_and_list_missing
|
||||
s3_options = {}
|
||||
|
||||
if (s3_inventory_bucket_region = SiteSetting.s3_inventory_bucket_region).present?
|
||||
s3_options[:region] = s3_inventory_bucket_region
|
||||
end
|
||||
|
||||
S3Inventory.new(:upload, s3_inventory_bucket:, s3_options:).backfill_etags_and_list_missing
|
||||
|
||||
unless skip_optimized
|
||||
S3Inventory.new(:optimized, s3_inventory_bucket:).backfill_etags_and_list_missing
|
||||
|
Reference in New Issue
Block a user