README.md in octokit-4.13.0 vs README.md in octokit-4.14.0
- old
+ new
@@ -28,10 +28,11 @@
3. [Interacting with the GitHub Enterprise Management Console APIs](#interacting-with-the-github-enterprise-management-console-apis)
9. [SSL Connection Errors](#ssl-connection-errors)
10. [Configuration and defaults](#configuration-and-defaults)
1. [Configuring module defaults](#configuring-module-defaults)
2. [Using ENV variables](#using-env-variables)
+ 3. [Timeouts](#timeouts)
11. [Hypermedia agent](#hypermedia-agent)
1. [Hypermedia in Octokit](#hypermedia-in-octokit)
2. [URI templates](#uri-templates)
3. [The Full Hypermedia Experience™](#the-full-hypermedia-experience)
12. [Upgrading guide](#upgrading-guide)
@@ -425,10 +426,31 @@
Deprecation warnings and API endpoints in development preview warnings are
printed to STDOUT by default, these can be disabled by setting the ENV
`OCTOKIT_SILENT=true`.
+### Timeouts
+
+By default, Octokit does not timeout network requests. To set a timeout, pass in Faraday timeout settings to Octokit's `connection_options` setting.
+
+```ruby
+Octokit.configure do |c|
+ c.api_endpoint = ENV.fetch('GITHUB_API_ENDPOINT', 'https://api.github.com/')
+ c.connection_options = {
+ request: {
+ open_timeout: 5,
+ timeout: 5
+ }
+ }
+end
+```
+You should set a timeout in order to avoid Ruby’s Timeout module, which can hose your server. Here are some resources for more information on this:
+
+- [The Oldest Bug In Ruby - Why Rack::Timeout Might Hose your Server](https://www.schneems.com/2017/02/21/the-oldest-bug-in-ruby-why-racktimeout-might-hose-your-server/)
+- [Timeout: Ruby's Most Dangerous API](https://www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/)
+- [The Ultimate Guide to Ruby Timeouts](https://github.com/ankane/the-ultimate-guide-to-ruby-timeouts)
+
## Hypermedia agent
Starting in version 2.0, Octokit is [hypermedia][]-enabled. Under the hood,
{Octokit::Client} uses [Sawyer][], a hypermedia client built on [Faraday][].
@@ -691,9 +713,10 @@
* Ruby 2.1
* Ruby 2.2
* Ruby 2.3
* Ruby 2.4
* Ruby 2.5
+* Ruby 2.6
If something doesn't work on one of these Ruby versions, it's a bug.
This library may inadvertently work (or seem to work) on other Ruby
implementations, but support will only be provided for the versions listed