Hi Josh I'm certainly open to considering a patch - just not thrilled about putting even more methods into ThinkingSphinx or ThinkingSphinx::Configuration. That said, I don't have any suggestions for a better location at the moment.
Anyway, a patch will be welcome. Cheers -- Pat On 14/09/2011, at 11:16 PM, Josh wrote: > Pay, > > So far so good. I'm liking it a lot. > > It would be nice if the contents of the rake tasks were one-liners > though. I'd suggest pulling it into a class method... something > like: module ThinkingSphinx.index! ; < do index stuff thats > currently in rake task> ; end > > ...that way I don'y have to copy TS code into my app... Also, since > it's no longer in a rake task it can be tested more thoroughly. > > Would you accept that patch if I sent a pull request? > > Thanks > > On Sep 14, 5:07 am, Pat Allan <[email protected]> wrote: >> Hi Josh >> >> If it works for you, then fantastic - I'm not familiar with rescue, so I >> can't offer much advice. From a TS perspective, your code looks fine :) >> >> -- >> Pat >> >> On 13/09/2011, at 11:05 AM, Josh wrote: >> >> >> >> >> >> >> >>> 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/th... >> >>> ...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 >>> athttp://groups.google.com/group/thinking-sphinx?hl=en. > > -- > 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. > -- 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.
