gaffneyc / sunspot-queue

Background search indexing using existing worker systems
MIT License
35 stars 37 forks source link

Allow configurable index/removal jobs #8

Closed zdennis closed 11 years ago

zdennis commented 11 years ago

The above change-set allows the default index/removal jobs for resque and sidekiq to be overridden via the following syntax:

Sunspot::Queue.configure do |c|
  c.resque_index_job = MyCustomIndexJob
  c.resque_removal_job = MyCustomRemovalJob
  c.sidekiq_index_job = MySidekiqIndexJob
  c.sidekiq_removal_job = MySidekidRemovalJob
end

Or without a block accessing the configuration object directly:

Sunspot::Queue.configuration.resque_index_job = MyCustomIndexJob

There are default jobs provided based on what was being used.

gaffneyc commented 11 years ago

I'll take a look at this later today and get it merged. Should be able to cut 0.10 soon after. Sorry it's taken me so long to get to it

gaffneyc commented 11 years ago

@zdennis: Thanks again, sorry it's taken me so long to get to this. It looks good though I'm going to refactor to:

Sunspot::Queue.configure do |c|
  c.index_job = CustomJob
  c.removal_job = CustomJob
end

We only support one worker system at a time, so I don't know that it's worth having configs for each one individually.

gaffneyc commented 11 years ago

This was shipped in 0.10.0

zdennis commented 11 years ago

woot! Thanks @gaffneyc !