about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-12-22 17:13:55 +0100
committerGitHub <noreply@github.com>2020-12-22 17:13:55 +0100
commit9915d11c0d7a15b6775af8e78fcc4d836368f88d (patch)
treeb6b5efe86ab2686eda673e81b10e05d17af30cf9 /lib
parent67ebd61f1180e63fcc671c583e7251e1e09755d9 (diff)
Fix unnecessary queries when batch-removing statuses, 100x faster (#15387)
Diffstat (limited to 'lib')
-rw-r--r--lib/chewy/strategy/custom_sidekiq.rb25
1 files changed, 3 insertions, 22 deletions
diff --git a/lib/chewy/strategy/custom_sidekiq.rb b/lib/chewy/strategy/custom_sidekiq.rb
index 3e54326ba..794ae4ed4 100644
--- a/lib/chewy/strategy/custom_sidekiq.rb
+++ b/lib/chewy/strategy/custom_sidekiq.rb
@@ -2,29 +2,10 @@
 
 module Chewy
   class Strategy
-    class CustomSidekiq < Base
-      class Worker
-        include ::Sidekiq::Worker
-
-        sidekiq_options queue: 'pull'
-
-        def perform(type, ids, options = {})
-          options[:refresh] = !Chewy.disable_refresh_async if Chewy.disable_refresh_async
-          type.constantize.import!(ids, options)
-        end
-      end
-
-      def update(type, objects, _options = {})
-        return unless Chewy.enabled?
-
-        ids = type.root.id ? Array.wrap(objects) : type.adapter.identify(objects)
-
-        return if ids.empty?
-
-        Worker.perform_async(type.name, ids)
+    class CustomSidekiq < Sidekiq
+      def update(_type, _objects, _options = {})
+        super if Chewy.enabled?
       end
-
-      def leave; end
     end
   end
 end