watermarkchurch / wcc-contentful

An alternative to Contentful's contentful.rb ruby client, contentful_model, and contentful_rails gems all in one.
MIT License
2 stars 1 forks source link

37 rate limit #186

Closed gburgett closed 5 years ago

gburgett commented 5 years ago

The gem's bottom layer interface to the network has been redesigned to implement the Faraday interface. For this reason the http_adapter config option has been replaced with connection. The connection config option can be a custom Faraday connection object or an adapter that quacks like it. If the app does not have faraday installed, then either Typhoeus or HTTP will be auto-discovered and used.

The SimpleClient now automatically retries on a Contentful rate-limit response. The maximum amount of time that the SimpleClient will wait when it is rate-limited is configurable, but defaults to 1.5 seconds. This allows the SimpleClient to retry once in the normal case when the CDN's per-second rate limit has been hit, but on a second rate limit error an ApiError will be raised.

fixes #37

watermarkchurch-bot commented 5 years ago
1 Warning
:warning: This is a big pull request - please break it up into smaller units of work

Generated by :no_entry_sign: Danger

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.07%) to 94.136% when pulling bcf4a6c6cc88c9c772c07cb955ee465a3af7d529 on 37_rate_limit into ac9f8641c44c166c2a845eceb499b77e7f3dc549 on master.