Commit 195c0f585ad6b9b9a3f6a0dcc5a30d4caf01b8ef
1 parent
4a8315fb
Exists in
master
and in
5 other branches
Fixed error with reindex queue - fixes #1506
Showing
3 changed files
with
8 additions
and
1 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/reindex_queue.rb
... | ... | @@ -15,7 +15,7 @@ module Searchkick |
15 | 15 | # TODO use reliable queuing |
16 | 16 | def reserve(limit: 1000) |
17 | 17 | if supports_rpop_with_count? |
18 | - Searchkick.with_redis { |r| r.call("rpop", redis_key, limit) } | |
18 | + Searchkick.with_redis { |r| r.call("rpop", redis_key, limit) }.to_a | |
19 | 19 | else |
20 | 20 | record_ids = [] |
21 | 21 | Searchkick.with_redis do |r| | ... | ... |
test/reindex_test.rb
... | ... | @@ -198,6 +198,9 @@ class ReindexTest < Minitest::Test |
198 | 198 | Product.searchkick_index.refresh |
199 | 199 | assert_search "product", ["Product A", "Product C"], load: false |
200 | 200 | assert_equal 0, reindex_queue.length |
201 | + | |
202 | + # ensure no error with empty queue | |
203 | + Searchkick::ProcessQueueJob.perform_later(class_name: "Product") | |
201 | 204 | end |
202 | 205 | |
203 | 206 | def test_transaction | ... | ... |