Delayed Deltas

27 views
Skip to first unread message

Pat Allan

unread,
Jan 2, 2009, 1:05:46 PM1/2/09
to thinkin...@googlegroups.com
Well, it's been a long time coming, but there's finally support for
delayed deltas, using delayed_job (fittingly). It is an internal copy
of dj, and I've not tested it with apps that also use the dj plugin,
but it should play nicely. Please do test, though.

How to make it work?

In your define_index block:
set_property :delta => :delayed

To get the background task running:
rake thinking_sphinx:delta
or
rake ts:delta

I'm not convinced about the task name, so you're warned it may change
(especially when deltas-by-timestamps is added - soon!).

I've tested it on various Rails versions (including 1.2.6), and as far
as I can tell, it works as it should. I've added cucumber features to
test it too, so I'm pretty happy with how it runs. That said, would
appreciate hearing how it works for everyone else :)

Get the code from Github:
http://github.com/freelancing-god/thinking-sphinx/tree/master

Enjoy

--
Pat
e: p...@freelancing-gods.com || m: +614 1327 3337
w: http://freelancing-gods.com || t: twitter.com/pat
discworld: http://ausdwcon.org || skype: patallan

Pat Allan

unread,
Jan 2, 2009, 10:11:46 PM1/2/09
to thinkin...@googlegroups.com
Oh, and the other step - not a problem for those already using
delayed_job - is to create the delayed_jobs table:

create_table :delayed_jobs, :force => true do |table|
table.integer :priority, :default => 0
table.integer :attempts, :default => 0
table.text :handler
table.string :last_error
table.datetime :run_at
table.datetime :locked_at
table.datetime :failed_at
table.string :locked_by
table.timestamps
end

Cheers

--
Pat

Pat Allan

unread,
Jan 3, 2009, 9:40:54 AM1/3/09
to thinkin...@googlegroups.com
Okay, I changed the name of the rake task:

rake thinking_sphinx:delayed_delta
rake ts:dd

Of course, if you're already using delayed_job, the delta requests
will get processed by the normal queue task.

--
Pat
Reply all
Reply to author
Forward
0 new messages