sunspot-queue icon indicating copy to clipboard operation
sunspot-queue copied to clipboard

sunspot-queue is not threadsafe

Open travisp opened this issue 9 years ago • 0 comments

Sidekiq uses threads to handle multiple workers, and the without_proxy helper is not threadsafe because it modifies Sunspot.session. The Sunspot::Queue::Sidekiq job workers can be modified to work safely like this:

    def perform(klass, id)
      object = constantize(klass).find(id)
      base_session = Sunspot.session.session
      base_session.index(object)
    end

travisp avatar May 29 '15 14:05 travisp