From 940a61037c02d17228ee06f9d05170f99dd6504a Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Fri, 4 Jan 2019 12:16:09 +0530 Subject: [PATCH] DEV: Add option to pass s3 client in param --- lib/s3_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/s3_helper.rb b/lib/s3_helper.rb index 6741debf6ab..427b6ceaa68 100644 --- a/lib/s3_helper.rb +++ b/lib/s3_helper.rb @@ -7,6 +7,7 @@ class S3Helper attr_reader :s3_bucket_name, :s3_bucket_folder_path def initialize(s3_bucket_name, tombstone_prefix = '', options = {}) + @s3_client = options.delete(:client) @s3_options = default_s3_options.merge(options) @s3_bucket_name, @s3_bucket_folder_path = begin @@ -224,7 +225,7 @@ class S3Helper end def s3_client - Aws::S3::Client.new(@s3_options) + @s3_client ||= Aws::S3::Client.new(@s3_options) end def s3_resource