ShopifyUnlimited
- Allows API calls like products = Product.find(:all, params:false), which will make as many requests as needed to fetch all Products in batches of 250. The result set can be queried for the number of requests required:
products.requests_made
2.Contains a throttle tuned for 4-8 workers consuming a single shop's api limit. It will keep all workers busy while limiting the number of refused requests. - Retries 404's once. This is because Shopify in the past has occasionally 404'd on count queries.
Installation
Add this line to your application's Gemfile:
gem 'shopify_unlimited'
And then execute:
$ bundle
Or install it yourself as:
$ gem install shopify_unlimited
Usage
- to fetch all records using behind the scenes batching, use find with limit: false
- to see the throttle in action, set ENV['SHOPIFY_UNLIMITED_DEBUG'] and it will log info to STDOUT
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request