So I created this resque worker:
class TsIndex
@queue = :ts_index
def self.perform
config = ThinkingSphinx::Configuration.instance
unless ENV["INDEX_ONLY"] == "true"
puts "Generating Configuration to #{config.config_file}"
config.build
end
FileUtils.mkdir_p config.searchd_file_path
config.controller.index :verbose => true
end
end
....which is blatantly stolen from here:
https://github.com/freelancing-god/thinking-sphinx/blob/master/lib/thinking_sphinx/tasks.rb#L87
...and I set it up to run using resque-scheduler:
https://github.com/bvandenbos/resque-scheduler
( I did the same thing for ts:in:delta )
So what was once a cron job, which loaded my full stack all the time,
unnecessarily rocking my CPU, is now just forked form resque, and
boom. done. So fast. No loading time, just indexing.
I feel like this was too easy. Thoughts? Did I miss something
insanely obvious?
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.