Skip to content

Commit

Permalink
Fix Redis client and type errors introduced in #24285 (#24342)
Browse files Browse the repository at this point in the history
  • Loading branch information
VyrCossont authored and ClearlyClaire committed Jul 6, 2023
1 parent 6f484fb commit 652ff76
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/workers/scheduler/indexing_scheduler.rb
Expand Up @@ -14,12 +14,10 @@ def perform

indexes.each do |type|
with_redis do |redis|
redis.sscan_each("chewy:queue:#{type.name}", count: SCAN_BATCH_SIZE) do |ids|
redis.pipelined do
ids.each_slice(IMPORT_BATCH_SIZE) do |slice_ids|
type.import!(slice_ids)
redis.srem("chewy:queue:#{type.name}", slice_ids)
end
redis.sscan_each("chewy:queue:#{type.name}", count: SCAN_BATCH_SIZE).each_slice(IMPORT_BATCH_SIZE) do |ids|
type.import!(ids)
redis.pipelined do |pipeline|
pipeline.srem("chewy:queue:#{type.name}", ids)
end
end
end
Expand Down

0 comments on commit 652ff76

Please sign in to comment.