From 6b01d0222b083b3b9f4b76e270ab9080b14b6528 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 17 Jan 2017 22:57:13 -0800 Subject: [PATCH] Added info about controlling concurrency [skip ci] --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 53ac0da..bbc5f7e 100644 --- a/README.md +++ b/README.md @@ -1199,6 +1199,23 @@ 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: + +```ruby +require "active_job/traffic_control" + +Searchkick.redis = Redis.new +ActiveJob::TrafficControl.client = Searchkick.redis + +class Searchkick::BulkReindexJob + include ActiveJob::TrafficControl::Concurrency + + concurrency 3, drop: false +end +``` + +This will allow only 3 jobs to run at once. + ### Refresh Interval You can specify a longer refresh interval while reindexing to increase performance. -- libgit2 0.21.0