qoobaa/s3

max_keys option of objects.find_all() is ignored

TelegramSam opened this issue · 3 comments

The fix for Issue #25 has introduced a bug that ignores max_keys.

Currently, find_all() will return all objects in the bucket, obeying prefix and marker.

This happens because the truncated flag is set as soon as the limit is reached, either by the default limit of 1000 or what you send in the max_keys option.

Further, performance is hindered, because it will only request up to max_keys at a time, so a max_keys of 100 will cause 10 request to happen instead of 1 when listing a bucket that returns 1000 keys.

The fix for #25 needs to be adjusted to allow for max_keys set as an option, and stop looping when the limit has been reached.

Hey!

If you create a patch for that I'll appreciate it. I haven't used the library for a while, I don't follow changes of the S3 API recently. I'm quite busy currently, I'll try to find some time to take a look at the library.

Thanks for patches and bug reports.

I submitted a pull request on github that contains the written fix. Is
that what you need, or a separate patch file?

-Sam

On Tue Jul 12 03:04:14 2011, qoobaa wrote:

Hey!

If you create a patch for that I'll appreciate it. I haven't used the library for a while, I don't follow changes of the S3 API recently. I'm quite busy currently, I'll try to find some time to take a look at the library.

Thanks for patches and bug reports.

Sure, that's enough. I didn't notice that pull request. Any tests for that?