Commit 0a17dd2e46dc8f55fe9aa225c5779dd953820ff0

Authored by Andrew Kane
1 parent 4fcadf8b

Better traffic control instructions [skip ci]

Showing 1 changed file with 7 additions and 6 deletions   Show diff stats
README.md
... ... @@ -1210,18 +1210,19 @@ And use:
1210 1210 Searchkick.reindex_status(index_name)
1211 1211 ```
1212 1212  
1213   -You can use [ActiveJob::TrafficControl](https://github.com/nickelser/activejob-traffic_control) to control concurrency. Install the gem and create an initializer with:
  1213 +You can use [ActiveJob::TrafficControl](https://github.com/nickelser/activejob-traffic_control) to control concurrency. Install the gem:
1214 1214  
1215 1215 ```ruby
1216   -require "active_job/traffic_control"
  1216 +gem 'activejob-traffic_control', '>= 0.1.3'
  1217 +```
1217 1218  
1218   -Searchkick.redis = Redis.new
  1219 +And create an initializer with:
  1220 +
  1221 +```ruby
1219 1222 ActiveJob::TrafficControl.client = Searchkick.redis
1220 1223  
1221 1224 class Searchkick::BulkReindexJob
1222   - include ActiveJob::TrafficControl::Concurrency
1223   -
1224   - concurrency 3, drop: false
  1225 + concurrency 3
1225 1226 end
1226 1227 ```
1227 1228  
... ...