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

GitHub API causes rate errors #666

Closed
crossan007 opened this issue Jun 8, 2016 · 1 comment
Closed

GitHub API causes rate errors #666

crossan007 opened this issue Jun 8, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@crossan007
Copy link
Contributor

It looks like there is a 60 request / hour limit on the GitHub API. Since we're calling this every time a page is loaded, we could very quickly reach this limit for end users:

Fatal error: Uncaught exception 'Github\Exception\ApiLimitExceedException' with message 'You have reached GitHub hour limit! Actual limit is: 60' in /var/www/public/vendor/knplabs/github-api/lib/Github/HttpClient/Listener/ErrorListener.php:45 Stack trace: #0 [internal function]: Github\HttpClient\Listener\ErrorListener->onRequestError(Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) #1 /var/www/public/vendor/symfony/event-dispatcher/EventDispatcher.php(184): call_user_func(Array, Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) #2 /var/www/public/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'request.error', Object(Guzzle\Common\Event)) #3 /var/www/public/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(589): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('request.error', Object(Guzzle\Common\Event)) #4 /var/www/ in /var/www/public/vendor/knplabs/github-api/lib/Github/HttpClient/HttpClient.php on line 145

I propose moving the code that does release checking into the system service, and leverage some kind of cron job: https://doc.owncloud.org/server/8.2/admin_manual/configuration_server/background_jobs_configuration.html

@crossan007 crossan007 changed the title GitHub API causes errors GitHub API causes rate errors Jun 8, 2016
@DawoudIO
Copy link
Contributor

DawoudIO commented Jun 8, 2016

Rate Limiting

For requests using Basic Authentication or OAuth, you can make up to 5,000 requests per hour. For unauthenticated requests, the rate limit allows you to make up to 60 requests per hour. Unauthenticated requests are associated with your IP address, and not the user making requests. Note that the Search API has custom rate limit rules.

If we do the check once per login and keep the flag in the session then we should be good for a server ip.

@DawoudIO DawoudIO added the bug label Jun 8, 2016
@DawoudIO DawoudIO added this to the 2.1.0 milestone Jun 8, 2016
@DawoudIO DawoudIO self-assigned this Jun 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants