From 3124da9cb7462ab1c5bc2870b0684eb7f9ae5da5 Mon Sep 17 00:00:00 2001 From: Orrin Naylor Date: Thu, 3 Mar 2022 22:02:14 -0700 Subject: [PATCH] Add warning messages around directories.get --- README.md | 1 + lib/fog/aws/models/storage/directories.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 13865c266..c7b571f44 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ file = directory.files.create(key: 'user/1/Gemfile', body: File.open('Gemfile'), directory = s3.directories.get('gaudi-portal-dev', prefix: 'user/1/') directory.files ``` +**Warning!** `s3.directories.get` retrieves and caches meta data for the first 10,000 objects in the bucket, which can be very expensive. When possible use `s3.directories.new`. #### Generating a URL for a file: diff --git a/lib/fog/aws/models/storage/directories.rb b/lib/fog/aws/models/storage/directories.rb index 64341509a..43c9741d5 100644 --- a/lib/fog/aws/models/storage/directories.rb +++ b/lib/fog/aws/models/storage/directories.rb @@ -11,6 +11,7 @@ module Fog load(data) end + # Warning! This retrieves and caches meta data for the first 10,000 objects in the bucket, which can be very expensive. When possible use directories.new def get(key, options = {}) remap_attributes(options, { :delimiter => 'delimiter',