Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getBucket() $maxKeys usage #21

Closed
capsandiego opened this issue Nov 25, 2021 · 1 comment
Closed

getBucket() $maxKeys usage #21

capsandiego opened this issue Nov 25, 2021 · 1 comment

Comments

@capsandiego
Copy link

capsandiego commented Nov 25, 2021

Nicholas, I do apologize if I wasn't clear on my previous request
Maybe this code will help:

Note: I'm using dev-development f0f6554 version with PHP 8.0.6

I have 1001 files in a bucket/folder. This code will never return (I run it for more than 40 minutes and it's still going). With 999 files it's super fast (les than 1 sec).
Could you please test and tell me what is my mistake?
Could you please give me a code fix proposal to read 1001 files?

$configuration = new Configuration(
                                   S3KEY,
                                   S3SECRET,
                                   'v4',
                                   S3REGION
                                  );
$connector     = new Connector($configuration);
$folder        = "test";
$bucket        = S3BUCKET;
$folder        = trim($folder, '/');

$files      = $connector->getBucket($bucket, $folder.'/', null, null);
@capsandiego
Copy link
Author

After more tests, I understood how to run several requests. It seems that the "secret" is to use the $marker Marker (last file listed) to run the subsequent requests.

Still $maxKeys = null doesn't work for 1001 files.
But this not an issue for now as I need to implement the multiple request process.

$files      = $connector->getBucket($bucket, $folder.'/', null, null); 

Thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant