From 0a17dd2e46dc8f55fe9aa225c5779dd953820ff0 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 26 Jan 2017 21:16:26 -0800 Subject: [PATCH] Better traffic control instructions [skip ci] --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index beb33a1..1d4c04b 100644 --- a/README.md +++ b/README.md @@ -1210,18 +1210,19 @@ And use: Searchkick.reindex_status(index_name) ``` -You can use [ActiveJob::TrafficControl](https://github.com/nickelser/activejob-traffic_control) to control concurrency. Install the gem and create an initializer with: +You can use [ActiveJob::TrafficControl](https://github.com/nickelser/activejob-traffic_control) to control concurrency. Install the gem: ```ruby -require "active_job/traffic_control" +gem 'activejob-traffic_control', '>= 0.1.3' +``` -Searchkick.redis = Redis.new +And create an initializer with: + +```ruby ActiveJob::TrafficControl.client = Searchkick.redis class Searchkick::BulkReindexJob - include ActiveJob::TrafficControl::Concurrency - - concurrency 3, drop: false + concurrency 3 end ``` -- libgit2 0.21.0