Skip to content

Conversation

johanbrandhorst
Copy link

Fixes #217

@gpocentek
Copy link
Contributor

Thank you for working on this, hitting the server limits is an annoying problem.

With your patch using all=True might return incomplete results, without any information given to the user. I'm not really fond of this behavior. Maybe we should give the user a choice: return a partial list, raise an exception (default, to keep the current behavior), or maybe wait a few seconds before continuing (see #166). What do you think?

@johanbrandhorst
Copy link
Author

Good point on incomplete results, I agree this should change to keep current behaviour. This patch does not concern itself with rate limiting though, just the python built-in recursion limit. I can add an option to return as many as possible (and capture the recursion limit exception), while maintaining the same behaviour for all=True.

@gpocentek
Copy link
Contributor

Oh right, I was focused on the API rate limit!

Adding the option would be great, thanks :)

Johan Brandhorst added 4 commits March 21, 2017 21:33
This new parameter works just like "all", except it will attempt to catch any recursion limit exceptions thrown. These errors could be countered if a large amount of values were being listed recursively.
or not issubclass(parent_cls, GitlabObject)
or parent_cls == CurrentUser):
or not issubclass(parent_cls, GitlabObject)
or parent_cls == CurrentUser):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My autopep8 linter did this, should I revert it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to revert, that's fine.

@gpocentek
Copy link
Contributor

This looks good to me, thank you for adding unit tests!

Could you have a look at the travis job failures? Thanks :)

@johanbrandhorst
Copy link
Author

Should fix the python2 errors

Gauvain Pocentek added 2 commits March 23, 2017 19:33
@gpocentek gpocentek merged commit 989f3b7 into python-gitlab:master Mar 23, 2017
@gpocentek
Copy link
Contributor

I fixed the pep8 issues, thank you for this patch!

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.

2 participants