FEATURE: Add hidden setting to disable configuration of inventory bucket

FEATURE: Add hidden setting to disable configuration of inventory bucket

diff --git a/app/jobs/regular/update_s3_inventory.rb b/app/jobs/regular/update_s3_inventory.rb
index 2d279268f0..46c34a59bf 100644
--- a/app/jobs/regular/update_s3_inventory.rb
+++ b/app/jobs/regular/update_s3_inventory.rb
@@ -7,7 +7,9 @@ module Jobs
   class UpdateS3Inventory < ::Jobs::Base
 
     def execute(args)
-      return unless SiteSetting.enable_s3_inventory? && SiteSetting.Upload.enable_s3_uploads
+      return unless SiteSetting.enable_s3_inventory? &&
+        SiteSetting.Upload.enable_s3_uploads &&
+        SiteSetting.s3_configure_inventory_policy
 
       [:upload, :optimized].each do |type|
         s3_inventory = S3Inventory.new(Discourse.store.s3_helper, type)
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 038b2b6b0b..43733e937c 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -1174,6 +1174,9 @@ files:
     default: true
   enable_s3_inventory:
     default: false
+  s3_configure_inventory_policy:
+    default: true
+    hidden: true
   allow_profile_backgrounds:
     client: true
     default: true

GitHub sha: c351ffe5

1 Like

There should be a test for that :wink:

1 Like

DEV: Add spec for disabled UpdateS3Inventory job