The code powering m.abunchtell.com https://m.abunchtell.com
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

31 řádky
685 B

  1. # frozen_string_literal: true
  2. module Chewy
  3. class Strategy
  4. class CustomSidekiq < Base
  5. class Worker
  6. include ::Sidekiq::Worker
  7. sidekiq_options queue: 'pull'
  8. def perform(type, ids, options = {})
  9. options[:refresh] = !Chewy.disable_refresh_async if Chewy.disable_refresh_async
  10. type.constantize.import!(ids, options)
  11. end
  12. end
  13. def update(type, objects, _options = {})
  14. return unless Chewy.enabled?
  15. ids = type.root.id ? Array.wrap(objects) : type.adapter.identify(objects)
  16. return if ids.empty?
  17. Worker.perform_async(type.name, ids)
  18. end
  19. def leave; end
  20. end
  21. end
  22. end