Skip to content

A platform for community discussion. Free, open, simple.

DB based S3 settings fixes for `s3:upload_assets`.

Guo Xiang Tana895626d1020
diff --git a/lib/tasks/s3.rake b/lib/tasks/s3.rake
index 34fb4ef6ceb..356ca55cc28 100644
--- a/lib/tasks/s3.rake
+++ b/lib/tasks/s3.rake
@@ -43,11 +43,20 @@ end
def helper
@helper ||= begin
- setting = use_db_s3_config ? SiteSetting : GlobalSetting
-
- S3Helper.new(
- setting.s3_bucket.downcase, '', S3Helper.s3_options(setting)
- )
+ bucket, options =
+ if use_db_s3_config
+ [
+ SiteSetting.s3_upload_bucket.downcase,
+ S3Helper.s3_options(SiteSetting)
+ ]
+ else
+ [
+ GlobalSetting.s3_bucket.downcase,
+ S3Helper.s3_options(GlobalSetting)
+ ]
+ end
+
+ S3Helper.new(bucket, '', options)
end
end