sunspot-queue
sunspot-queue copied to clipboard
sunspot-queue is not threadsafe
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