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

Changing auto_paginate on Octokit doesn't affect current instances #554

Closed
sb8244 opened this issue Jan 31, 2015 · 12 comments
Closed

Changing auto_paginate on Octokit doesn't affect current instances #554

sb8244 opened this issue Jan 31, 2015 · 12 comments
Labels
Status: Stale Used by stalebot to clean house Type: Documentation Improvements or additions to documentation

Comments

@sb8244
Copy link

sb8244 commented Jan 31, 2015

If you have a client instance, then change Octokit.auto_paginate, it doesn't affect the current client instance. Changing client.auto_paginate does have the correct effect, of course. It's not really a bug so much as it is confusing

@pengwynn
Copy link
Collaborator

@sb8244 Yeah, that's pretty much by design. Sorry you found that confusing. We'd welcome a patch to update that section of the README to make that a bit clearer.

@sb8244
Copy link
Author

sb8244 commented Jan 31, 2015

Awesome I will do that! I ended up writing a little client extension with a method of

def with_pagination
    self.auto_paginate = true
    yield
  ensure
    self.auto_paginate = false
  end

This way I could pass a GithubClient (my simple extension of Octokit::Client) around my application without having to create a new one every time. I'm not sure if this API interface is welcome or not (and it's fine either way), but I did find it useful / explicit which was nice.

@sb8244
Copy link
Author

sb8244 commented Jan 31, 2015

Love the library by the way! Thanks Wynn and other contributors!

@pengwynn
Copy link
Collaborator

@sb8244 That's pretty nifty. I'd be more inclined to let it ensure the pagination setting without inadvertently flipping the setting, surprising other callers. What about:

def with_pagination
  pagination_setting = self.auto_paginate 
  self.auto_paginate = true
  yield
ensure
  self.auto_paginate = pagination_setting
end

Maybe we could even bake this into the auto_paginate method itself, yielding if a block is given, setting the value if there's no block?

@sb8244
Copy link
Author

sb8244 commented Jan 31, 2015

Good call there! Do you mind if I tackle a simple implementation and tests?

On Saturday, January 31, 2015, Wynn Netherland [email protected]
wrote:

@sb8244 https://github.com/sb8244 That's pretty nifty. I'd be more
inclined to let it ensure the pagination setting without inadvertently
flipping the setting, surprising other callers. What about:

def with_pagination
pagination_setting = self.auto_paginate
self.auto_paginate = true
yieldensure
self.auto_paginate = pagination_settingend

Maybe we could even bake this into the auto_paginate method itself,
yielding if a block is given, setting the value if there's no block?


Reply to this email directly or view it on GitHub
#554 (comment).

Steve Bussey •SalesLoft

•Software Engineer

e [email protected] w salesloft.com
http://salesloft.com/?v=1&utm_expid=76406993-1.E5ncJhwyTAW9uGaR1WdBTA.1?utm_source=Email-Signature-Rescue&utm_medium=Email-Signature&utm_campaign=Email-Signature-Rescue

a 3423 Piedmont Rd NE, Atlanta, GA 30305

[image: Facebook] https://www.facebook.com/SalesLoft [image: Twitter]
https://twitter.com/SalesLoft [image: Linkedin]
https://www.linkedin.com/company/salesloft [image: wordpress]
http://blog.salesloft.com/blog/ [image:
http://salesloft.com/prospector/#video]
http://salesloft.com/prospector/#video [image: Software Engineer Logo]
http://salesloft.com/?v=1&utm_expid=76406993-1.E5ncJhwyTAW9uGaR1WdBTA.1?utm_source=Email-Signature-Rescue&utm_medium=Email-Signature&utm_campaign=Email-Signature-Rescue

@pengwynn
Copy link
Collaborator

@sb8244 nope, go for it!

@ghost
Copy link

ghost commented Jul 30, 2015

@pengwynn i have been running into same kind of problem. I have enabled auto_paginate which is not able to paginate means it couldn't display for what i ask for?

@pengwynn
Copy link
Collaborator

@aruzmeister can you share a code snippet to see if you're running into the same issue as the original topic here?

@ghost
Copy link

ghost commented Aug 12, 2015

@pengwynn It's good. auto_paginate works fine the problem was with my server which couldn't get too much request at once. I have already figured out :)

@sb8244
Copy link
Author

sb8244 commented Aug 12, 2015

I think github changed something. It's nearly impossible for me to page the
1k prs on a repo. Freezes my console continuously for minutes at a time

On Wednesday, August 12, 2015, Aruj Parajuli [email protected]
wrote:

@pengwynn https://github.com/pengwynn It's good. auto_paginate works
fine the problem was with my server which couldn't get too much request at
once. I have already figured out :)


Reply to this email directly or view it on GitHub
#554 (comment).

Steve Bussey •SalesLoft

•Software Engineer

e [email protected] w salesloft.com
http://salesloft.com/?v=1&utm_expid=76406993-1.E5ncJhwyTAW9uGaR1WdBTA.1?utm_source=Email-Signature-Rescue&utm_medium=Email-Signature&utm_campaign=Email-Signature-Rescue

a 3423 Piedmont Rd NE, Atlanta, GA 30305

[image: Facebook] https://www.facebook.com/SalesLoft [image: Twitter]
https://twitter.com/SalesLoft [image: Linkedin]
https://www.linkedin.com/company/salesloft [image: wordpress]
http://blog.salesloft.com/blog/ [image:
http://salesloft.com/prospector/#video]
http://salesloft.com/prospector/#video [image: Software Engineer Logo]
http://salesloft.com/?v=1&utm_expid=76406993-1.E5ncJhwyTAW9uGaR1WdBTA.1?utm_source=Email-Signature-Rescue&utm_medium=Email-Signature&utm_campaign=Email-Signature-Rescue

@ghost
Copy link

ghost commented Aug 13, 2015

@sb8244 I think so you can configure that by increasing the incoming limit so that it won't freezes.

@github-actions
Copy link

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Jul 28, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Used by stalebot to clean house Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

7 participants
@pengwynn @nickfloyd @kytrinyx @sb8244 and others