mirror of
https://github.com/discourse/discourse.git
synced 2025-06-11 05:53:49 +08:00
DEV: Add option to pass s3 client in param
This commit is contained in:
@ -7,6 +7,7 @@ class S3Helper
|
|||||||
attr_reader :s3_bucket_name, :s3_bucket_folder_path
|
attr_reader :s3_bucket_name, :s3_bucket_folder_path
|
||||||
|
|
||||||
def initialize(s3_bucket_name, tombstone_prefix = '', options = {})
|
def initialize(s3_bucket_name, tombstone_prefix = '', options = {})
|
||||||
|
@s3_client = options.delete(:client)
|
||||||
@s3_options = default_s3_options.merge(options)
|
@s3_options = default_s3_options.merge(options)
|
||||||
|
|
||||||
@s3_bucket_name, @s3_bucket_folder_path = begin
|
@s3_bucket_name, @s3_bucket_folder_path = begin
|
||||||
@ -224,7 +225,7 @@ class S3Helper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def s3_client
|
def s3_client
|
||||||
Aws::S3::Client.new(@s3_options)
|
@s3_client ||= Aws::S3::Client.new(@s3_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def s3_resource
|
def s3_resource
|
||||||
|
Reference in New Issue
Block a user