about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-04-01 14:31:05 +0200
committerClaire <claire.github-309c@sitedethib.com>2023-04-01 14:31:05 +0200
commit7b15f4006adb5f8f04d83174532c30eeb78757b0 (patch)
tree686c30ed5f6c4cfe5f6b4d84e46ff19f7baa6949 /app/workers
parentd874a7a10f7cab9b3fe2eb3a088b7c0dff95c7ee (diff)
parent46483ae849bc06ee74f4745f4564b213e742c51c (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/scheduler/indexing_scheduler.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/workers/scheduler/indexing_scheduler.rb b/app/workers/scheduler/indexing_scheduler.rb
index 1bbe9cd5d..d622f5586 100644
--- a/app/workers/scheduler/indexing_scheduler.rb
+++ b/app/workers/scheduler/indexing_scheduler.rb
@@ -14,12 +14,10 @@ class Scheduler::IndexingScheduler
 
     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