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

ensure to retrieve all pages when using #files with given block #558

Merged

Conversation

jgigault
Copy link
Contributor

@jgigault jgigault commented Jan 11, 2022

we should take "page_next_token" into account while listing pages through #files
this reproduces the behaviour we have with GoogleXML files collection

I guess that this should fix known issue #42

Example of usage:

connection =
  ::Fog::Storage.new(
    provider:               'Google',
    google_project:        '...',
    google_json_key_string: '...'
  )

bucket_name = '...'

directory = connection.directories.get(bucket_name)

files = directory.files.each_with_object([]) { |file, results| results << file }

files.size # can now be greater than 1000

take page_next_token into account while listing pages through #files
as we do in GoogleXML connection and "is_truncated" attribute
@geemus
Copy link
Member

geemus commented Jan 13, 2022

At a glance at least this seems reasonable enough, but I don't have a test account and haven't used this directly in a while.

@Temikus any chance you could take a peek and review? Thanks!

@Temikus
Copy link
Member

Temikus commented Jan 13, 2022

@geemus yeah, of course! Just a busy week so I’ll take a look on a Saturday.

@geemus
Copy link
Member

geemus commented Jan 13, 2022

@Temikus no rush, just happened to see it and wanted to make sure it was on your radar. Thanks!

@Temikus Temikus merged commit 8fa62f2 into fog:master Jan 15, 2022
@geemus
Copy link
Member

geemus commented Jan 15, 2022

Thanks!

@jgigault-pa
Copy link

Thank you!

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

Successfully merging this pull request may close these issues.

4 participants